现代设计方法课后习题解答
现代设计方法习题答案
![现代设计方法习题答案](https://img.taocdn.com/s3/m/815cc3cbaa00b52acfc7caa5.png)
3.用梯度法求下列无约束优化问题:MinF(X)=x12+4x22,设初始点取为X(0)={2,2}T,以梯度模为终止迭代准则,其收敛精度为5。
1)求初始点梯度▽F(X)▽F(X)={2x1,8x2}T▽F(X(0))={4,16}T(2)第一次搜索|▽F(X(0))|=16.5,S(0)=- ▽F(X(0))/16.5=-{0.243,0.97}Tα(0)=2.157X(1)=X(0)+α(0)S(0)={1.476,-0.923}T▽F(x(1))={2.952,-0.738}T|▽F(x(1))|=3.043<5.0故满足要求,停止迭代。
最优点X*={1.476,-0.0923}T最优值F(X*)=2.214.5.6.用外点法求解约束优化问题:()()12211221min ..0()0f X x x s tg X x x g X x =+=-≤=-≤ , 收敛准则:(1)()0.10.01k k XX εδ+-≤=,约束容限= 解:(1)利用外点法惩罚法构造无约束优化问题()()12()22()212121(min ,()()k k k x x X rx x r x x r x +⎧⎪Φ=⎨++-+-⎪⎩可行域内)(可行域外)(2)此例只是为了说明外点法的思路,用微分法求解上述无约束优化问题。
用极值条件求解:在可行域内:偏导数不可能等于0,即可行域内无极值在可行域外,令:()2()11211()212214()2012()0k k k r x x x r x x r x x x ∂Φ=+-+=∂∂Φ=--=∂从上面两式解得 12()()2()111,2(1)4(1)2k k k x x r r r =-=-++ 可见,对于不同的惩罚因子值,可以得到不同的极小点。
【令()k r→∞,即可得到原问题的最优解**(0,0),()0T X f X ==】(3)取(0)(1)()()1,10k k k r r Cr r +===进行迭代计算,迭代结果如下:(1)(1)(1)(2)(2)(2)(2)(1)(3)(3)(3)(3)(2)1(0.25,0.4375),()0.687510,(0.0455,0.0479),()0.0934,0.44100(0.00495,0.00498),()0.00993,0.059T T r X f X r X f X X X r X f X X X εε==--=-==--=--=>==--=--=<当时,当时当时, 点(3)X满足点距收敛准则,同时,它在约束容限范围内,因此,终止迭代!输出结果7.已知一轴的危险断面上,同时作用有弯矩M 和转矩T ,如图所示。
现代工程设计制图习题集(第四版)参考答案
![现代工程设计制图习题集(第四版)参考答案](https://img.taocdn.com/s3/m/c713074902d8ce2f0066f5335a8102d276a261b4.png)
第四版习题集更加注重实践应用,增加了大量来自于实际工程案例 的题目,帮助学生更好地将理论知识应用于实践中。
提高了题目质量
第四版习题集的题目经过了精心的设计和筛选,质量更高、更具代表 性,能够更好地帮助学生掌握工程设计制图的核心技能。
习题集使用方法和建议
系统性使用
建议学生按照章节顺序,系统性地完成习题集中的题目, 以全面掌握工程设计制图的知识和技能。
透视图的分类
根据观察者和物体之间的相对位置关系以及投影面的选择不同,透视图可分为一点透视、 两点透视和三点透视三种类型。其中,一点透视和两点透视是常用的透视图类型。
06
工程图样的表达方法
视图表达方法
基本视图 向视图 局部视图 斜视图
根据正投影法绘制出物体的六个基本视图,即主视图、俯视图 、左视图、右视图、仰视图和后视图。
三视图的投影规律
长对正、高平齐、宽相等。即主视图与俯视图长度相等且对正,主视图与左视 图高度相等且平齐,俯视图与左视图宽度相等。
基本几何体的三视图
平面立体的三视图
棱柱、棱锥等平面立体的三视图,要 注意各视图的形状和尺寸标注。
回转体的三视图
圆柱、圆锥、圆球等回转体的三视图 ,要注意各视图的形状、尺寸标注和 截交线、相贯线的画法。
AutoCAD软件的操作界面及 工具栏介绍
AutoCAD软件的基本操作技 巧与快捷键使用
二维图形绘制与编辑命令
尺寸标注、文字标注等
二维图形标注命令
移动、旋转、缩放、镜像等
二维图形编辑命令
直线、圆、圆弧、多边形等
二维图形绘制命令
三维建模与渲染技术
三维建模命令
拉伸、旋转、放样、布尔运算等
三维渲染技术
C语言程序设计:现代方法(第2版)第二章全部习题答案
![C语言程序设计:现代方法(第2版)第二章全部习题答案](https://img.taocdn.com/s3/m/aa090ae6bb0d4a7302768e9951e79b89680268a6.png)
C语⾔程序设计:现代⽅法(第2版)第⼆章全部习题答案前⾔本⼈在通过《C语⾔程序设计:现代⽅法(第2版)》⾃学C语⾔时,发现国内并没有该书完整的课后习题答案,所以就想把⾃⼰在学习过程中所做出的答案分享出来,以供⼤家参考。
这些答案是本⼈⾃⼰解答,并参考GitHub上相关的分享和相关资料。
因为并没有权威的答案来源,所以可能会存在错误的地⽅,如有错误还希望⼤家能够帮助指出。
第⼆章练习题和编程题答案练习题2.2节1.建⽴并运⾏由Kernighan和Ritchie编写的著名的“hello world”程序:1 #include <stdio.h>2 int main(void)3 {4 printf("hello world!\n");5 }在编译时是否有警告信息?如果有,需要如何改进呢?答:如果使⽤部分⽐较⽼的编译器如turbo C等,会⽣成警告信息,指出main函数并没有返回任何值。
这是因为在声明main函数时使⽤了int,表明函数会返回⼀个整型数值,这个数值为任意(因为main后⾯是void)。
但是上⾯的代码中并没有return语句,所以并不会返回任何值。
加⼊return语句后便可消除警告。
1 /* 加⼊return语句后的版本 */2 #include <stdio.h>3 int main(void)4 {5 printf("Hello world!\n");6 return 0;7 }如果是使⽤IDE中的编译器,且IDE版本⽐较新(如本⼈⽬前使⽤的Code:Blocks)即使没有return语句,编译器也不会⽣成警告信息。
2.思考下⾯的程序:1 #include <stdio.h>2int main(void)3 {4 printf("Parkinson's Law:\nWork expands so as to ");5 printf("fill the time\n");6 printf("available for its completion.\n");7return0;8 }(a)请指出程序中的指令和语句。
现代设计方法习题集及答案
![现代设计方法习题集及答案](https://img.taocdn.com/s3/m/11fcb43f0a4e767f5acfa1c7aa00b52acfc79c8a.png)
现代设计方法习题集及答案《现代设计方法》课程习题集【说明】:本课程《现代设计方法》(编号为02200)共有单选题,填空题1,计算题,简答题等多种试题类型,其中,本习题集中有[单选题,填空题1,计算题,简答题]等试题类型未进入。
一、单选题1.在CAD使用中,为了方便定义图形通常采用不同坐标系,在以下坐标系中,坐标系的定义域是连续且无界的是()A.世界坐标系B.显示器坐标系C.规格化设备坐标系D.绘图仪坐标系2.工程数据处理中,使用线性插值法完成()A.一元插值B.二元插值C.曲线拟合D.曲线绘制3.三维几何造型是CAD中的一种()A.图形处理技术B.工程分析技术C.文档处理技术D.软件设计技术4. CAD系统中,支撑用户进行CAD工作的通用性功能软件是()A.系统软件B.支撑软件C.专用操作软件D.专用应用软件5.若在CAD系统中,固定窗口参数,同时缩小视区高度和宽度,则视图内图形A.比例增大B.比例缩小C.左右移动D.上下移动6. CAD系统中不是按其描述和存储内容的特征划分的几何模型()A.线框几何模型B.表面几何模型C.实体几何模型D.曲面几何模型7. 世界坐标系、设备坐标系、规格化坐标系的转换关系是()A .WC→DC→NDCB .NDC→DC→WC C .WC→NDC→DCD .DC→WC→N DC8. 参数化绘图在定义图形时关键是利用了图形的()A .相似性B .多样性C .个别性D .特殊性9.下列设备不属于CAD 作业输入设备的,有()A .绘图仪B .键盘C .数字化仪D .光笔10.为使窗口—视区变换后的图形在视区中输出而不失真,则()A .yb xl W W =ybxl V V B .yt xr W W =yt xr V Vyb yt xl xr W W W W --=yb yt xlxr V V V V -- D .yt xr yb xl V V W W --=ytxr yb xl W W V W --11. 平面问题的弹性矩阵与材料的()A.弹性模量有关,泊松比无关B.弹性模量无关,泊松比有关C.弹性模量和泊松比都无关D.弹性模量和泊松比都有关12. 三维图形变换矩阵=s nmlr j i h q f e dp c b aT ,中l 表示产生的() A.比例变换 B.对称变换 C.错切变换 D.平移变换13.二维图形比例变换矩阵中??=d a T 00,可有()A.a=0,d=1 B. a=1,d=0 C. a=d=1 D. a=d=014.已知变换矩阵=100020001T ,则图形将在() A .X 方向放大2倍 B .Y 方向放大2倍C .X 方向平移2D .Y 方向平移215. 三维图形变换矩阵=s nmlr j i h q f e dp c b a T 中,[l m n ]表示产生() A .比例变换 B .对称变换C .错切变换D .平移变换16.一个多元函数F(X)在点x*附近偏导数连续,则该点为极小点的充分条件是()A.0*)(=?x FB.0*)(=?x F ,H(x*)正定C.H(x*)=0D.0*)(=?x F ,H(x*)负定17. 内点罚函数法的特点是()A.能处理等式约束问题B.初始点必须在可行域内C. 初始点可以在可行域外D.后面产生的迭代点序列可以在可行域外18. 对于一个无约束优化问题,若其一阶、二阶偏导数易计算,且计算变量不多(n≤20),宜选用的优化方法是()A.拟牛顿法B.变尺度法C.0.618法D.二次插值法19. 设计体积500cm 3的圆柱形包装盒,按用料最省的原则要确定其高度H 和直径D ,其设计变量是()A.重量B.直径C.面积D.体积20. 多元函数F(X)在点x*附近偏导数连续,0*)(=?x F ,H(x*)负定,则该点为F(X)的()A.极大值点B. 极小值点C.鞍点D.不连续点21. 在单峰搜索区间[x 1, x 3](x 1<="" 4="" bdsfid="181" p="">内,若x 2>x 4,并且函数F(x 4)<="" x4]="" )="">22.下列特性中,梯度法不具有的是()A.二次收敛性B.要计算一阶偏导数C.对初始点的要求不高D.只利用目标函数的一阶偏导数值构成搜索方向23.对于极小化F(x),而受限于约束g μ(x)≤0(μ= 0,1,2,…,m)的优化问题,其内点罚函数表达式为()A.∑=-=Φmk k X g rX F rX 1)()()(/1)(),(μμ B.∑=+=Φmk k X g rX F r X 1)()()(/1)(),(μμ C.∑=-=Φmk k X g rX F r X 1)()()](,0max [)(),(μμ D.∑=-=Φmk k X g rX F r X 1)()()](,0min[)(),(μμ 24.设X =(X 1, X 2,…, X n ),R n 为维欧氏空间,则下述正确的是()A .设计空间是 n 维欧氏空间R nB .设计空间是 n 维欧氏空间R n 中落在可行域内的部分C .设计变量在具体设计问题中的迭代值是唯一的D .设计变量是指设计对象中用到的所有变量25. 函数22),(1323121+-+=x x x x x F 在点Tx }2,1{=处的梯度是()A. T }12,1{B.T }1,8{C. T}3,1{ D.T}8,0{26. 对于 n 维正定二次函数,沿一组共轭方向依次作一维搜索,当达到极值点时,最多需要搜索()A .n +1 次B .n 次C .n -1次D .2n 次27. 函数F (X )为在区间[10,20]内有极小值的单峰函数,进行一维搜索时,取两点13和16,若F (13)<F (16),则缩小后的区间为()A .[13,16]B .[10,13]C .[10,16]D .[16,20]28. 梯度法与变尺度法所具有的收敛性分别为()A .一次收敛性.一次收敛性B .二次收敛性.二次收敛性C .一次收敛性.二次收敛性D .二次收敛性.一次收敛性29.设F (X )为区间(0,3)上的单峰函数,且F (1)=2、F (2)=1.5,则可将搜索区间(0,3)缩小为()A .(0,2)B .(1,2)C .(2,3)D .(1,3)30. 求f(x 1,x 2)=2x 12-8x 1+2x 22-4x 2+20的极值及极值点()A. x*=[1,1]T 12B.x*=[2,1]T 10 C. x*=[2,2]T 12 D. x*=[1,0]T 1431. 串联系统的失效模式大多服从()A.正态分布B.对数正态分布C.指数分布D.威布尔分布32. 抽取100只灯泡进行实验,灯泡工作到50小时有12只损坏,工作到70小时有20只损坏,从50小时到70小时这段时间内灯泡的平均失效密度是() A.0.006 B.0.004 C.0.01 D.0.1233. 由三个相同的元件组成的并联系统,系统正常工作的条件是至少有两个元件处于正常工作状态,每个元件的可靠度为R=0.9,则系统的可靠度为() A.0.972 B.0.99 C.0.999 D.0.999734. 当转换开关的可靠度为1时,非工作冗余系统的可靠度为R1, 工作冗余系统的可靠度为R2,则R1与R2之间的关系为()A. R1<R2B. R1>R2C. R1= R2D. R1≤R235. 下列可靠性指标关系式不正确的是()A .dtt dF t f )()(= B .1)()(=+t F t R C .?∞=tdt t tf t R )()( D .?∞=0)(dt t tf T36. 正态分布中的标准差是()A.表征随机变量分布的离散程度B.表征随机变量分布的集中趋势C.决定正态分布曲线的位置D.影响正态分布曲线的对称性37.若知某产品的失效密度f(t),则其平均寿命T 可表为()A.?t dt t f 0)( B.?∞tdt t f )( C.?∞tdt t f t f )()( D.?∞)(dt t tf38.随机变量A 和B 均服从正态分布,即A=N(μ1,σ1);A=N(μ2,σ2),则随机变量A在(μ1-2σ1)~(μ1-σ1)之间分布的百分数与随机变量 B 在(μ2+σ2)~(μ2+2σ2)之间分布的百分数()A.之比为-σ1/σ2B.之比为σ1/σ2C.之比为-σ2/σ1D.相等39. 标准正态分布是定义为()A.μ=1,σ=0.5的正态分布B.μ=1,σ=1的正态分布C.μ=0,σ=1的正态分布D.μ=0.5,σ=1的正态分布40. 零件的强度和应力均服从正态分布,即N(μr ,σr ); N(μs ,σs ),且知μr >μs ,当σr 增大时,零件的可靠度()A.提高B.降低C.不变D.不定41. 某产品的寿命服从指数分布,若知其失效率λ=0.002,则该产品的平均寿命为()A.200B.1000C.500D.200042. 要提高可靠性的置信度,不应()A.增加强度的样本容量B.加大强度的标准差C.减少应力的均值D.增加应力的样本容量43.N 台具有相同可靠度为R 的设备组成系统,若系统允许 r 台设备失效仍认为正常工作,则该系统的可靠度函数R S 为() A .R S =∑=---ri iin i n n R R C )1( B .R S =∑=--ni r rn r n R RC)1(C .R S =rr n r nR R C )1(-- D .R S =∑=---ri r rn r n R RC)1(144.N 台具有相同可靠度为R 的设备组成系统,若系统允许 r 台设备失效仍认为正常工作,则该系统的可靠度函数R S 为() A .R S =∑=---nri iin i n n R R C )1( B .R S =∑=--nn r n R RC)1(C .R S =rr n r nR R C )1(-- D .R S =∑=---ri r rn r n R RC)1(145. 对于2/3表决系统,下列情况中,系统不能正常工作的是()A .a 、b 失效,c 正常B .a 失效,b 、c 正常C .a 、b 、c 正常D .a 、b 正常,c 失效46.N 台具有相同可靠度为R 的设备组成系统,恰好有r 台设备失效时系统的可靠度为() A .R S =∑=--ri rr n r n R R C 0)1( B .R S =∑=--ni r rn r n R RC)1( C .R S =rrn r n R R C )1(-- D .R S =∑=---ri r rn r n R RC)1(147. 根据强度—应力干涉理论可以判定,当强度均值 r 等于应力均值s 时,则零件可靠度R 的值()A .小于0.5B .大于0.5C .等于0.5D .等于148.N 个产品进行可靠性试验,在t ~t +△t 时间内的失效数为N f (t ),t 时刻的累积失效数N f (t ),则t 时刻的存活频率为()A .Nt N N f )(- B .Nt N f )( C .t N t N f ??)( D .t t N N t N ff ??)]([)(-49.在t ~t +△t 的时间间隔内的平均失效密度f (t )表示()A .平均单位时间的失效频数B .平均单位时间的失效频率C .产品工作到t 时刻,单位时间内发生失效的概率D .产品工作到t 时刻,单位时间内发生的失效数与仍在正常工作的数之比50.设试验数为N 0,累积失效数为N f (t),仍正常工作数N s (t),则存活频率是指()A .0)(N t N f B .0)(N t N s C .)()(t N t N f s D .)()(t N t N s f二、填空题1 51.计算机辅助设计(CAD)是指人们在计算机的辅助下,对产品或工程进行设计、绘图、分析计算或编写技术文件以及显示、输出的一种设计方法。
现代设计方法课后答案
![现代设计方法课后答案](https://img.taocdn.com/s3/m/3c6e1a106bd97f192279e976.png)
第一章计算机辅助设计(CAD)
1.什么是CAD?什么是CAD系统?
它是指人们在计算机软硬件的辅助下对产品或工程进行设计、绘图、分析计算、修改和编写技术文件以及显示、输出的一种设计方法。
一般把应用于CAD作业的计算机、软件及外围设备,总称为CAD系统。
2.为什么CAD系统大都采用人机交互工作?
CAD不是完全的设计自动化。
实践经验证明,完全的设计自动化是非常困难的。
CAD是将人的主导性与创造性放在首位的,同时发挥计算机的长处,使二者有机的结合起来,从而提高设计质量、缩短设计周期、降低设计费用。
3.CAD技术在机械工业中有哪些主要应用?结合你用过或见到过的“CAD的应用”举一例说明。
①二维绘图②图形及符号库③参数化设计④三维造型⑤工程分析⑥设计文档和生成报表。
4.。
c语言程序设计现代方法(第二版)习题答案
![c语言程序设计现代方法(第二版)习题答案](https://img.taocdn.com/s3/m/76bdfbce050876323112120f.png)
Chapter 2Answers to Selected Exercises2. [was #2] (a) The program contains one directive (#include) and four statements (three calls of printf and one return).(b)Parkinson's Law:Work expands so as to fill the timeavailable for its completion.3. [was #4]#include <stdio.h>int main(void){int height = 8, length = 12, width = 10, volume;volume = height * length * width;printf("Dimensions: %dx%dx%d\n", length, width, height);printf("Volume (cubic inches): %d\n", volume);printf("Dimensional weight (pounds): %d\n", (volume + 165) / 166);return 0;}4. [was #6] Here's one possible program:#include <stdio.h>int main(void){int i, j, k;float x, y, z;printf("Value of i: %d\n", i);printf("Value of j: %d\n", j);printf("Value of k: %d\n", k);printf("Value of x: %g\n", x);printf("Value of y: %g\n", y);printf("Value of z: %g\n", z);return 0;}When compiled using GCC and then executed, this program produced the following output:Value of i: 5618848Value of j: 0Value of k: 6844404Value of x: 3.98979e-34Value of y: 9.59105e-39Value of z: 9.59105e-39The values printed depend on many factors, so the chance that you'll get exactly these numbers is small.5. [was #10] (a) is not legal because 100_bottles begins with a digit.8. [was #12] There are 14 tokens: a, =, (, 3, *, q, -, p, *, p, ), /, 3, and ;.Answers to Selected Programming Projects4. [was #8; modified]#include <stdio.h>int main(void){float original_amount, amount_with_tax;printf("Enter an amount: ");scanf("%f", &original_amount);amount_with_tax = original_amount * 1.05f;printf("With tax added: $%.2f\n", amount_with_tax);return 0;}The amount_with_tax variable is unnecessary. If we remove it, the program is slightly shorter:#include <stdio.h>int main(void){float original_amount;printf("Enter an amount: ");scanf("%f", &original_amount);printf("With tax added: $%.2f\n", original_amount * 1.05f);return 0;}Chapter 3Answers to Selected Exercises2. [was #2](a) printf("%-8.1e", x);(b) printf("%10.6e", x);(c) printf("%-8.3f", x);(d) printf("%6.0f", x);5.[was #8] The values of x, i, and y will be 12.3, 45, and .6, respectively. Answers to Selected Programming Projects1. [was #4; modified]#include <stdio.h>int main(void){int month, day, year;printf("Enter a date (mm/dd/yyyy): ");scanf("%d/%d/%d", &month, &day, &year);printf("You entered the date %d%.2d%.2d\n", year, month, day);return 0;}3. [was #6; modified]#include <stdio.h>int main(void){int prefix, group, publisher, item, check_digit;printf("Enter ISBN: ");scanf("%d-%d-%d-%d-%d", &prefix, &group, &publisher, &item,&check_digit);printf("GS1 prefix: %d\n", prefix);printf("Group identifier: %d\n", group);printf("Publisher code: %d\n", publisher);printf("Item number: %d\n", item);printf("Check digit: %d\n", check_digit);/* The five printf calls can be combined as follows:printf("GS1 prefix: %d\nGroup identifier: %d\nPublishercode: %d\nItem number: %d\nCheck digit: %d\n",prefix, group, publisher, item, check_digit);*/return 0;}Chapter 4Answers to Selected Exercises2.[was #2] Not in C89. Suppose that i is 9 and j is 7. The value of (-i)/j could be either –1 or –2, depending on the implementation. On the other hand, the value of -(i/j) is always –1, regardless of the implementation. In C99, on the other hand, the value of (-i)/j must be equal to the value of -(i/j).9. [was #6](a) 63 8(b) 3 2 1(c) 2 -1 3(d) 0 0 013. [was #8] The expression ++i is equivalent to (i += 1). The value of both expressions is i after the increment has been performed.Answers to Selected Programming Projects2. [was #4]#include <stdio.h>int main(void){int n;printf("Enter a three-digit number: ");scanf("%d", &n);printf("The reversal is: %d%d%d\n", n % 10, (n / 10) % 10, n / 100);return 0;}Chapter 5Answers to Selected Exercises2. [was #2](a) 1(b) 1(c) 1(d) 14. [was #4] (i > j) - (i < j)6. [was #12] Yes, the statement is legal. When n is equal to 5, it does nothing, since 5 is not equal to –9.10. [was #16] The output isonetwosince there are no break statements after the cases.Answers to Selected Programming Projects2. [was #6]#include <stdio.h>int main(void){int hours, minutes;printf("Enter a 24-hour time: ");scanf("%d:%d", &hours, &minutes);printf("Equivalent 12-hour time: ");if (hours == 0)printf("12:%.2d AM\n", minutes);else if (hours < 12)printf("%d:%.2d AM\n", hours, minutes);else if (hours == 12)printf("%d:%.2d PM\n", hours, minutes);elseprintf("%d:%.2d PM\n", hours - 12, minutes);return 0;}4. [was #8; modified]#include <stdio.h>int main(void){int speed;printf("Enter a wind speed in knots: ");scanf("%d", &speed);if (speed < 1)printf("Calm\n");else if (speed <= 3)printf("Light air\n");else if (speed <= 27)printf("Breeze\n");else if (speed <= 47)printf("Gale\n");else if (speed <= 63)printf("Storm\n");elseprintf("Hurricane\n");return 0;}6. [was #10]#include <stdio.h>int main(void){int check_digit, d, i1, i2, i3, i4, i5, j1, j2, j3, j4, j5, first_sum, second_sum, total;printf("Enter the first (single) digit: ");scanf("%1d", &d);printf("Enter first group of five digits: ");scanf("%1d%1d%1d%1d%1d", &i1, &i2, &i3, &i4, &i5);printf("Enter second group of five digits: ");scanf("%1d%1d%1d%1d%1d", &j1, &j2, &j3, &j4, &j5);printf("Enter the last (single) digit: ");scanf("%1d", &check_digit);first_sum = d + i2 + i4 + j1 + j3 + j5;second_sum = i1 + i3 + i5 + j2 + j4;total = 3 * first_sum + second_sum;if (check_digit == 9 - ((total - 1) % 10))printf("VALID\n");elseprintf("NOT VALID\n");return 0;}10. [was #14]#include <stdio.h>int main(void){int grade;printf("Enter numerical grade: ");scanf("%d", &grade);if (grade < 0 || grade > 100) {printf("Illegal grade\n");return 0;}switch (grade / 10) {case 10:case 9: printf("Letter grade: A\n");break;case 8: printf("Letter grade: B\n");break;case 7: printf("Letter grade: C\n");break;case 6: printf("Letter grade: D\n");break;case 5:case 4:case 3:case 2:case 1:case 0: printf("Letter grade: F\n");break;}return 0;}Chapter 6Answers to Selected Exercises4.[was #10] (c) is not equivalent to (a) and (b), because i is incremented before the loop body is executed.10. [was #12] Consider the following while loop:while (…) {…continue;…}The equivalent code using goto would have the following appearance:while (…) {…goto loop_end;…loop_end: ; /* null statement */}12. [was #14]for (d = 2; d * d <= n; d++)if (n % d == 0)break;The if statement that follows the loop will need to be modified as well:if (d * d <= n)printf("%d is divisible by %d\n", n, d);elseprintf("%d is prime\n", n);14. [was #16] The problem is the semicolon at the end of the first line. If we remove it, the statement is now correct:if (n % 2 == 0)printf("n is even\n");Answers to Selected Programming Projects2. [was #2]#include <stdio.h>int main(void){int m, n, remainder;printf("Enter two integers: ");scanf("%d%d", &m, &n);while (n != 0) {remainder = m % n;m = n;n = remainder;}printf("Greatest common divisor: %d\n", m);return 0;}4. [was #4]#include <stdio.h>int main(void){float commission, value;printf("Enter value of trade: ");scanf("%f", &value);while (value != 0.0f) {if (value < 2500.00f)commission = 30.00f + .017f * value;else if (value < 6250.00f)commission = 56.00f + .0066f * value;else if (value < 20000.00f)commission = 76.00f + .0034f * value;else if (value < 50000.00f)commission = 100.00f + .0022f * value;else if (value < 500000.00f)commission = 155.00f + .0011f * value;elsecommission = 255.00f + .0009f * value;if (commission < 39.00f)commission = 39.00f;printf("Commission: $%.2f\n\n", commission);printf("Enter value of trade: ");scanf("%f", &value);}return 0;}6. [was #6]#include <stdio.h>int main(void){int i, n;printf("Enter limit on maximum square: ");scanf("%d", &n);for (i = 2; i * i <= n; i += 2)printf("%d\n", i * i);return 0;}8. [was #8]#include <stdio.h>int main(void){int i, n, start_day;printf("Enter number of days in month: ");scanf("%d", &n);printf("Enter starting day of the week (1=Sun, 7=Sat): "); scanf("%d", &start_day);/* print any leading "blank dates" */for (i = 1; i < start_day; i++)printf(" ");/* now print the calendar */for (i = 1; i <= n; i++) {printf("%3d", i);if ((start_day + i - 1) % 7 == 0)printf("\n");}return 0;}Chapter 7Answers to Selected Exercises3. [was #4] (b) is not legal.4.[was #6] (d) is illegal, since printf requires a string, not a character, as its first argument.10.[was #14] unsigned int, because the (int) cast applies only to j, not j * k.12. [was #16] The value of i is converted to float and added to f, then the result is converted to double and stored in d.14. [was #18] No. Converting f to int will fail if the value stored inf exceeds the largest value of type int.Answers to Selected Programming Projects1.[was #2] short int values are usually stored in 16 bits, causing failure at 182. int and long int values are usually stored in 32 bits, with failure occurring at 46341.2. [was #8]#include <stdio.h>int main(void){int i, n;char ch;printf("This program prints a table of squares.\n");printf("Enter number of entries in table: ");scanf("%d", &n);ch = getchar();/* dispose of new-line character following number of entries *//* could simply be getchar(); */for (i = 1; i <= n; i++) {printf("%10d%10d\n", i, i * i);if (i % 24 == 0) {printf("Press Enter to continue...");ch = getchar(); /* or simply getchar(); */}}return 0;}5. [was #10]#include <ctype.h>#include <stdio.h>int main(void){int sum = 0;char ch;printf("Enter a word: ");while ((ch = getchar()) != '\n')switch (toupper(ch)) {case 'D': case 'G':sum += 2; break;case 'B': case 'C': case 'M': case 'P':sum += 3; break;case 'F': case 'H': case 'V': case 'W': case 'Y': sum += 4; break;case 'K':sum += 5; break;case 'J': case 'X':sum += 8; break;case 'Q': case 'Z':sum += 10; break;default:sum++; break;}printf("Scrabble value: %d\n", sum);return 0;}6. [was #12]#include <stdio.h>int main(void){printf("Size of int: %d\n", (int) sizeof(int));printf("Size of short: %d\n", (int) sizeof(short));printf("Size of long: %d\n", (int) sizeof(long));printf("Size of float: %d\n", (int) sizeof(float));printf("Size of double: %d\n", (int) sizeof(double));printf("Size of long double: %d\n", (int) sizeof(long double));return 0;}Since the type of a sizeof expression may vary from one implementation to another, it's necessary in C89 to cast sizeof expressions to a known type before printing them. The sizes of the basic types are small numbers, so it's safe to cast them to int. (In general, however, it's best to cast sizeof expressions to unsigned long and print them using %lu.) In C99, we can avoid the cast by using the %zu conversion specification.Chapter 8Answers to Selected Exercises1.[was #4] The problem with sizeof(a) / sizeof(t) is that it can't easily be checked for correctness by someone reading the program. (The reader would have to locate the declaration of a and make sure that its elements have type t.)2. [was #8] To use a digit d (in character form) as a subscript into the array a, we would write a[d-'0']. This assumes that digits have consecutive codes in the underlying character set, which is true of ASCII and other popular character sets.7. [was #10]const int segments[10][7] = {{1, 1, 1, 1, 1, 1},{0, 1, 1},{1, 1, 0, 1, 1, 0, 1},{1, 1, 1, 1, 0, 0, 1},{0, 1, 1, 0, 0, 1, 1},{1, 0, 1, 1, 0, 1, 1},{1, 0, 1, 1, 1, 1, 1},{1, 1, 1},{1, 1, 1, 1, 1, 1, 1},{1, 1, 1, 1, 0, 1, 1}};Answers to Selected Programming Projects2. [was #2]#include <stdio.h>int main(void){int digit_count[10] = {0};int digit;long n;printf("Enter a number: ");scanf("%ld", &n);while (n > 0) {digit = n % 10;digit_count[digit]++;n /= 10;}printf ("Digit: ");for (digit = 0; digit <= 9; digit++)printf("%3d", digit);printf("\nOccurrences:");for (digit = 0; digit <= 9; digit++)printf("%3d", digit_count[digit]);printf("\n");return 0;}5. [was #6]#include <stdio.h>#define NUM_RATES ((int) (sizeof(value) / sizeof(value[0]))) #define INITIAL_BALANCE 100.00int main(void){int i, low_rate, month, num_years, year;double value[5];printf("Enter interest rate: ");scanf("%d", &low_rate);printf("Enter number of years: ");scanf("%d", &num_years);printf("\nYears");for (i = 0; i < NUM_RATES; i++) {printf("%6d%%", low_rate + i);value[i] = INITIAL_BALANCE;}printf("\n");for (year = 1; year <= num_years; year++) {printf("%3d ", year);for (i = 0; i < NUM_RATES; i++) {for (month = 1; month <= 12; month++)value[i] += ((double) (low_rate + i) / 12) / 100.0 * value[i]; printf("%7.2f", value[i]);}printf("\n");}return 0;}8. [was #12]#include <stdio.h>#define NUM_QUIZZES 5#define NUM_STUDENTS 5int main(void){int grades[NUM_STUDENTS][NUM_QUIZZES];int high, low, quiz, student, total;for (student = 0; student < NUM_STUDENTS; student++) {printf("Enter grades for student %d: ", student + 1);for (quiz = 0; quiz < NUM_QUIZZES; quiz++)scanf("%d", &grades[student][quiz]);}printf("\nStudent Total Average\n");for (student = 0; student < NUM_STUDENTS; student++) {printf("%4d ", student + 1);total = 0;for (quiz = 0; quiz < NUM_QUIZZES; quiz++)total += grades[student][quiz];printf("%3d %3d\n", total, total / NUM_QUIZZES);}printf("\nQuiz Average High Low\n");for (quiz = 0; quiz < NUM_QUIZZES; quiz++) {printf("%3d ", quiz + 1);total = 0;high = 0;low = 100;for (student = 0; student < NUM_STUDENTS; student++) {total += grades[student][quiz];if (grades[student][quiz] > high)high = grades[student][quiz];if (grades[student][quiz] < low)low = grades[student][quiz];}printf("%3d %3d %3d\n", total / NUM_STUDENTS, high, low); }return 0;}Chapter 9Answers to Selected Exercises2. [was #2]int check(int x, int y, int n){return (x >= 0 && x <= n - 1 && y >= 0 && y <= n - 1);}4. [was #4]int day_of_year(int month, int day, int year){int num_days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int day_count = 0, i;for (i = 1; i < month; i++)day_count += num_days[i-1];/* adjust for leap years, assuming they are divisible by 4 */if (year % 4 == 0 && month > 2)day_count++;return day_count + day;}Using the expression year % 4 == 0 to test for leap years is not completely correct. Centuries are special cases: if a year is a multiple of 100, then it must also be a multiple of 400 in order to be a leap year. The correct test isyear % 4 == 0 && (year % 100 != 0 || year % 400 == 0)6. [was #6; modified]int digit(int n, int k){int i;for (i = 1; i < k; i++)n /= 10;return n % 10;}8. [was #8] (a) and (b) are valid prototypes. (c) is illegal, since it doesn't specify the type of the parameter. (d) incorrectly specifies that f returns an int value in C89; in C99, omitting the return type is illegal.10. [was #10](a)int largest(int a[], int n){int i, max = a[0];for (i = 1; i < n; i++)if (a[i] > max)max = a[i];return max;}(b)int average(int a[], int n){int i, avg = 0;for (i = 0; i < n; i++)avg += a[i];return avg / n;}(c)int num_positive(int a[], int n){int i, count = 0;for (i = 0; i < n; i++)if (a[i] > 0)count++;return count;}15. [was #12; modified]double median(double x, double y, double z) {double result;if (x <= y)if (y <= z) result = y;else if (x <= z) result = z;else result = x;else {if (z <= y) result = y;else if (x <= z) result = x;else result = z;}return result;}17. [was #14]int fact(int n){int i, result = 1;for (i = 2; i <= n; i++)result *= i;return result;}19. [was #16] The following program tests the pb function:#include <stdio.h>void pb(int n);int main(void){int n;printf("Enter a number: ");scanf("%d", &n);printf("Output of pb: ");pb(n);printf("\n");return 0;}void pb(int n){if (n != 0) {pb(n / 2);putchar('0' + n % 2);}}pb prints the binary representation of the argument n, assuming that n is greater than 0. (We also assume that digits have consecutive codes in the underlying character set.) For example:Enter a number: 53Output of pb: 110101A trace of pb's execution would look like this:pb(53) finds that 53 is not equal to 0, so it callspb(26), which finds that 26 is not equal to 0, so it calls pb(13), which finds that 13 is not equal to 0, so it calls pb(6), which finds that 6 is not equal to 0, so it callspb(3), which finds that 3 is not equal to 0, so it callspb(1), which finds that 1 is not equal to 0, so it callspb(0), which finds that 0 is equal to 0, so it returns, causingpb(1) to print 1 and return, causingpb(3) to print 1 and return, causingpb(6) to print 0 and return, causingpb(13) to print 1 and return, causingpb(26) to print 0 and return, causingpb(53) to print 1 and return.Chapter 10Answers to Selected Exercises1. [was #2] (a) a, b, and c are visible.(b) a, and d are visible.(c) a, d, and e are visible.(d) a and f are visible.Answers to Selected Programming Projects3. [was #4]#include <stdbool.h> /* C99 only */#include <stdio.h>#include <stdlib.h>#define NUM_CARDS 5#define RANK 0#define SUIT 1/* external variables */int hand[NUM_CARDS][2];/* 0 1____ ____0 |____|____|1 |____|____|2 |____|____|3 |____|____|4 |____|____|rank suit*/bool straight, flush, four, three;int pairs; /* can be 0, 1, or 2 *//* prototypes */void read_cards(void);void analyze_hand(void);void print_result(void);/********************************************************** * main: Calls read_cards, analyze_hand, and print_result * * repeatedly. * **********************************************************/ int main(void){for (;;) {read_cards();analyze_hand();print_result();}}/********************************************************** * read_cards: Reads the cards into the external variable * * hand; checks for bad cards and duplicate * * cards. * **********************************************************/ void read_cards(void){char ch, rank_ch, suit_ch;int i, rank, suit;bool bad_card, duplicate_card;int cards_read = 0;while (cards_read < NUM_CARDS) {bad_card = false;printf("Enter a card: ");rank_ch = getchar();switch (rank_ch) {case '0': exit(EXIT_SUCCESS);case '2': rank = 0; break;case '3': rank = 1; break;case '4': rank = 2; break;case '5': rank = 3; break;case '6': rank = 4; break;case '7': rank = 5; break;case '8': rank = 6; break;case '9': rank = 7; break;case 't': case 'T': rank = 8; break;case 'j': case 'J': rank = 9; break;case 'q': case 'Q': rank = 10; break;case 'k': case 'K': rank = 11; break;case 'a': case 'A': rank = 12; break;default: bad_card = true;}suit_ch = getchar();switch (suit_ch) {case 'c': case 'C': suit = 0; break;case 'd': case 'D': suit = 1; break;case 'h': case 'H': suit = 2; break;case 's': case 'S': suit = 3; break;default: bad_card = true;}while ((ch = getchar()) != '\n')if (ch != ' ') bad_card = true;if (bad_card) {printf("Bad card; ignored.\n");continue;}duplicate_card = false;for (i = 0; i < cards_read; i++)if (hand[i][RANK] == rank && hand[i][SUIT] == suit) { printf("Duplicate card; ignored.\n");duplicate_card = true;break;}if (!duplicate_card) {hand[cards_read][RANK] = rank;hand[cards_read][SUIT] = suit;cards_read++;}}}/********************************************************** * analyze_hand: Determines whether the hand contains a * * straight, a flush, four-of-a-kind, * * and/or three-of-a-kind; determines the * * number of pairs; stores the results into * * the external variables straight, flush, * * four, three, and pairs. * **********************************************************/ void analyze_hand(void){int rank, suit, card, pass, run;straight = true;flush = true;four = false;three = false;pairs = 0;/* sort cards by rank */for (pass = 1; pass < NUM_CARDS; pass++)for (card = 0; card < NUM_CARDS - pass; card++) {rank = hand[card][RANK];suit = hand[card][SUIT];if (hand[card+1][RANK] < rank) {hand[card][RANK] = hand[card+1][RANK];hand[card][SUIT] = hand[card+1][SUIT];hand[card+1][RANK] = rank;hand[card+1][SUIT] = suit;}}/* check for flush */suit = hand[0][SUIT];for (card = 1; card < NUM_CARDS; card++)if (hand[card][SUIT] != suit)flush = false;/* check for straight */for (card = 0; card < NUM_CARDS - 1; card++)if (hand[card][RANK] + 1 != hand[card+1][RANK])straight = false;/* check for 4-of-a-kind, 3-of-a-kind, and pairs bylooking for "runs" of cards with identical ranks */card = 0;while (card < NUM_CARDS) {rank = hand[card][RANK];run = 0;do {run++;card++;} while (card < NUM_CARDS && hand[card][RANK] == rank); switch (run) {case 2: pairs++; break;case 3: three = true; break;case 4: four = true; break;}}}/********************************************************** * print_result: Prints the classification of the hand, * * based on the values of the external * * variables straight, flush, four, three, * * and pairs. * **********************************************************/ void print_result(void){if (straight && flush) printf("Straight flush");else if (four) printf("Four of a kind");else if (three &&pairs == 1) printf("Full house");else if (flush) printf("Flush");else if (straight) printf("Straight");else if (three) printf("Three of a kind");else if (pairs == 2) printf("Two pairs");else if (pairs == 1) printf("Pair");else printf("High card");printf("\n\n");}5. [was #6]#include <stdbool.h> /* C99 only */#include <stdio.h>#include <stdlib.h>#define NUM_RANKS 13#define NUM_SUITS 4#define NUM_CARDS 5/* external variables */int num_in_rank[NUM_RANKS];int num_in_suit[NUM_SUITS];bool straight, flush, four, three;int pairs; /* can be 0, 1, or 2 *//* prototypes */void read_cards(void);void analyze_hand(void);void print_result(void);/********************************************************** * main: Calls read_cards, analyze_hand, and print_result * * repeatedly. * **********************************************************/ int main(void){for (;;) {read_cards();analyze_hand();print_result();}}/********************************************************** * read_cards: Reads the cards into the external * * variables num_in_rank and num_in_suit; * * checks for bad cards and duplicate cards. * **********************************************************/void read_cards(void){bool card_exists[NUM_RANKS][NUM_SUITS];char ch, rank_ch, suit_ch;int rank, suit;bool bad_card;int cards_read = 0;for (rank = 0; rank < NUM_RANKS; rank++) { num_in_rank[rank] = 0;for (suit = 0; suit < NUM_SUITS; suit++) card_exists[rank][suit] = false;}for (suit = 0; suit < NUM_SUITS; suit++)num_in_suit[suit] = 0;while (cards_read < NUM_CARDS) {bad_card = false;printf("Enter a card: ");rank_ch = getchar();switch (rank_ch) {case '0': exit(EXIT_SUCCESS); case '2': rank = 0; break;case '3': rank = 1; break;case '4': rank = 2; break;case '5': rank = 3; break;case '6': rank = 4; break;case '7': rank = 5; break;case '8': rank = 6; break;case '9': rank = 7; break;case 't': case 'T': rank = 8; break;case 'j': case 'J': rank = 9; break;case 'q': case 'Q': rank = 10; break; case 'k': case 'K': rank = 11; break; case 'a': case 'A': rank = 12; break; default: bad_card = true;}suit_ch = getchar();switch (suit_ch) {case 'c': case 'C': suit = 0; break;。
现代设计理论与方法 课后答案
![现代设计理论与方法 课后答案](https://img.taocdn.com/s3/m/934f424d4b7302768e9951e79b89680203d86ba8.png)
现代设计理论与方法课后答案
现代设计理论与方法包括以下几个方面:
1. 人机交互设计理论与方法:人机交互设计关注如何使人
与计算机系统之间的交互更加有效、高效和愉悦。
常用的
方法包括用户需求调研、用户界面设计、用户测试和评估等。
2. 用户体验设计理论与方法:用户体验设计关注用户在使
用产品或服务时的感受和满意度。
常用的方法包括用户调研、用户旅程地图绘制、用户故事编写和用户测试等。
3. 设计思维理论与方法:设计思维是一种以人为中心的创
新方法,通过观察、洞察、理解和提出解决方案来解决问题。
常用的方法包括问题定义、创意生成、原型制作和测
试验证等。
4. 可持续设计理论与方法:可持续设计关注如何在设计过
程中考虑环境、社会和经济的可持续性。
常用的方法包括
生命周期评估、材料选择、能源效率和循环利用等。
5. 创新设计理论与方法:创新设计关注如何通过创造性思
维和方法来提供新的解决方案。
常用的方法包括设计思维、设计工作坊、创意技术和设计策略等。
6. 数据驱动设计理论与方法:数据驱动设计关注如何通过
数据分析和用户行为来指导设计决策。
常用的方法包括用
户行为分析、A/B测试、数据可视化和用户反馈分析等。
7. 敏捷设计理论与方法:敏捷设计是一种以快速迭代和团队合作为核心的设计方法。
常用的方法包括敏捷开发、原型制作、用户反馈和迭代设计等。
以上是现代设计理论与方法的一些常见内容,具体的课后答案可能会根据具体的课程内容而有所不同。
C语言程序设计现代方法第二版习题答案CProgramming_AModernApproach
![C语言程序设计现代方法第二版习题答案CProgramming_AModernApproach](https://img.taocdn.com/s3/m/631c91fbcf84b9d528ea7ab1.png)
Answers to Selected Exercises2. [was #2] (a) The program contains one directive (#include) and four statements (three calls of printf and one return).(b)Parkinson's Law:Work expands so as to fill the timeavailable for its completion.3. [was #4]#include <stdio.h>int main(void){int height = 8, length = 12, width = 10, volume;volume = height * length * width;printf("Dimensions: %dx%dx%d\n", length, width, height); printf("Volume (cubic inches): %d\n", volume);printf("Dimensional weight (pounds): %d\n", (volume + 165) / 166);return 0;}4. [was #6] Here's one possible program:#include <stdio.h> int main(void){int i, j, k; float x, y, z;printf("Value of i: %d\n", i); printf("Value of j: %d\n", j); printf("Value of k: %d\n", k); printf("Value of x: %g\n", x); printf("Value of y: %g\n", y);printf("Value of z: %g\n", z);return 0;}When compiled using GCC and then executed, this program produced the following output:Value of i: 5618848Value of k: 6844404Value of x: 3.98979e-34Value of y: 9.59105e-39Value of z: 9.59105e-39The values printed depend on many factors, so the chance that you'll get exactly these numbers is small.5. [was #10] (a) is not legal because 100_bottles begins with a digit.8. [was #12] There are 14 tokens: a, =, (, 3, *, q, -, p, *, p, ), /, 3, and ;. Answers to Selected Programming Projects4. [was #8; modified]#include <stdio.h>int main(void){float original_amount, amount_with_tax;printf("Enter an amount: ");scanf("%f", &original_amount); amount_with_tax = original_amount * 1.05f; printf("With tax added: $%.2f\n", amount_with_tax);return 0;}The amount_with_tax variable is unnecessary. If we remove it, the program is slightly shorter:#include <stdio.h>int main(void){float original_amount;printf("Enter an amount: ");scanf("%f", &original_amount);printf("With tax added: $%.2f\n", original_amount * 1.05f);return 0;}Answers to Selected Exercises2. [was #2](a) printf("%-8.1e", x);(b) printf("%10.6e", x);(c) printf("%-8.3f", x);(d) printf("%6.0f", x);5. [was #8] The values of x, i, and y will be 12.3, 45, and .6,respectively. Answers to Selected Programming Projects1. [was #4; modified]#include <stdio.h>int main(void){int month, day, year;printf("Enter a date (mm/dd/yyyy): "); scanf("%d/%d/%d", &month, &day, &year); printf("You entered the date %d%.2d%.2d\n", year, month, day);return 0;}3. [was #6; modified]#include <stdio.h> int main(void){int prefix, group, publisher, item, check_digit;printf("Enter ISBN: ");scanf("%d-%d-%d-%d-%d", &prefix, &group, &publisher, &item, &check_digit); printf("GS1 prefix: %d\n", prefix); printf("Group identifier: %d\n", group);printf("Publisher code: %d\n", publisher); printf("Item number: %d\n", item); printf("Check digit: %d\n", check_digit);/* The five printf calls can be combined as follows:printf("GS1 prefix: %d\nGroup identifier: %d\nPublisher code: %d\nItem number: %d\nCheck digit: %d\n", prefix, group, publisher, item, check_digit);*/return 0; }Answers to Selected Exercises2. [was #2] Not in C89. Suppose that i is 9 and j is 7. The value of (-i)/j could be either —1 or —2, depending on the implementation. On the other hand, the value of -(i/j) is always —1, regardless of the implementation.In C99, on the other hand, the value of (-i)/j must be equal to the value of -(i/j).9. [was #6](a) 63 8(b) 3 2 1(c) 2 -1 3(d) 0 0 013. [was #8] The expression ++i is equivalent to (i += 1). The value of both expressions is i after the increment has been performed.Answers to Selected Programming Projects2. [was #4]#include <stdio.h>int main(void){int n;printf("Enter a three-digit number: ");scanf("%d", &n);printf("The reversal is: %d%d%d\n", n % 10, (n / 10) % 10, n / 100);return 0;}Chapter 5Answers to Selected Exercises2. [was #2](a) 1(b) 1(c) 1(d) 14. [was #4] (i > j) - (i < j)6. [was #12] Yes, the statement is legal. When n is equal to 5, it does nothing, since 5 is not equal to - 9.10. [was #16] The output isonetwosince there are no break statements after the cases.Answers to Selected Programming Projects2. [was #6]#include <stdio.h> int main(void){int hours, minutes;printf("Enter a 24-hour time: "); scanf("%d:%d", &hours, &minutes);printf("Equivalent 12-hour time: ");if (hours == 0)printf("12:%.2d AM\n", minutes);else if (hours < 12)printf("%d:%.2d AM\n", hours, minutes);else if (hours == 12)printf("%d:%.2d PM\n", hours, minutes); elseprintf("%d:%.2d PM\n", hours - 12, minutes);return 0;}4. [was #8; modified]#include <stdio.h> int main(void){int speed;printf("Enter a wind speed in knots: "); scanf("%d", &speed);if (speed < 1)printf("Calm\n");else if (speed <= 3)printf("Light air\n");else if (speed <= 27) printf("Breeze\n");else if (speed <= 47) printf("Gale\n");else if (speed <= 63)printf("Storm\n");elseprintf("Hurricane\n");return 0;}6. [was #10]#include <stdio.h> int main(void){int check_digit, d, i1, i2, i3, i4, i5, j1, j2, j3, j4, j5, first_sum, second_sum, total;printf("Enter the first (single) digit: ");scanf("%1d", &d);printf("Enter first group of five digits: "); scanf("%1d%1d%1d%1d%1d", &i1, &i2,&i3, &i4, &i5); printf("Enter second group of five digits: ");scanf("%1d%1d%1d%1d%1d", &j1, &j2, &j3, &j4, &j5); printf("Enter the last (single) digit: ");scanf("%1d", &check_digit);first_sum = d + i2 + i4 + j1 + j3 + j5;second_sum = i1 + i3 + i5 + j2 + j4;total = 3 * first_sum + second_sum;if (check_digit == 9 - ((total - 1) % 10)) printf("VALID\n");elseprintf("NOT VALID\n");return 0;}10. [was #14]#include <stdio.h>int main(void){int grade;printf("Enter numerical grade: ");scanf("%d", &grade);if (grade < 0 || grade > 100) { printf("Illegal grade\n"); return 0;}switch (grade / 10) {case 10:case 9: printf("Letter grade: A\n"); break;case 8: printf("Letter grade: B\n"); break;case 7: printf("Letter grade: C\n"); break;case 6: printf("Letter grade: D\n"); break;case 5:case 4:case 3:case 2:case 1:case 0: printf("Letter grade: F\n"); break;}return 0;}Chapter 6Answers to Selected Exercises4. [was #10] (c) is not equivalent to (a) and (b), because i is incremented before the loop body is executed.10. [was #12] Consider the following while loop:while (…){continue;The equivalent code using goto would have the following appearance: while (…){goto loop_end;loop_end: ; /* null statement */}12. [was #14]for (d = 2; d * d <= n; d++) if (n % d == 0)}break;The if statement that follows the loop will need to be modified as well: if (d * d <= n)printf("%d is divisible by %d\n", n, d);elseprintf("%d is prime\n", n);14. [was #16] The problem is the semicolon at the end of the first line. If we remove it, the statement is now correct:if (n % 2 == 0) printf("n is even\n");Answers to Selected Programming Projects2. [was #2]#include <stdio.h>int main(void){int m, n, remainder;printf("Enter two integers: "); scanf("%d%d", &m, &n);while (n != 0) {remainder = m % n;m = n; n = remainder;printf("Greatest common divisor: %d\n", m);return 0;}4. [was #4]#include <stdio.h>int main(void){float commission, value;printf("Enter value of trade: ");scanf("%f", &value);while (value != 0.0f) {if (value < 2500.00f)commission = 30.00f + .017f * value;else if (value < 6250.00f) commission = 56.00f + .0066f * value;else if (value < 20000.00f)commission = 76.00f + .0034f * value;else if (value < 50000.00f) commission = 100.00f + .0022f * value;else if (value < 500000.00f)commission = 155.00f + .0011f * value;elsecommission = 255.00f + .0009f * value;if (commission < 39.00f)commission = 39.00f;printf("Commission: $%.2f\n\n", commission);printf("Enter value of trade: ");scanf("%f", &value);}return 0;}6. [was #6]#include <stdio.h> int main(void){int i, n;printf("Enter limit on maximum square: "); scanf("%d", &n);for (i = 2; i * i <= n; i += 2) printf("%d\n", i * i);return 0;}8. [was #8]#include <stdio.h> int main(void){int i, n, start_day;printf("Enter number of days in month: ");scanf("%d", &n);printf("Enter starting day of the week (1=Sun, 7=Sat): "); scanf("%d", &start_day);/* print any leading "blank dates" */for (i = 1; i < start_day; i++)printf(" ");/* now print the calendar */ for (i = 1; i <= n; i++) { printf("%3d", i);if ((start_day + i - 1) % 7 == 0) printf("\n");}return 0;}Chapter 7Answers to Selected Exercises3. [was #4] (b) is not legal.4. [was #6] (d) is illegal, since printf requires a string, not a character, as its first argument.10. [was #14] unsigned int, because the (int) cast applies only to j, not j * k.12. [was #16] The value of i is converted to float and added to f, then the result is converted to double and stored in d.14. [was #18] No. Converting f to int will fail if the value stored in f exceeds the largest value of type int.Answers to Selected Programming Projects 1. [was #2] short int values are usually stored in 16 bits, causing failure at 182. int and long int values are usually stored in 32 bits, with failure occurring at 46341.2. [was #8]#include <stdio.h> int main(void){int i, n;char ch;printf("This program prints a table of squares.\n"); printf("Enter number of entries in table: "); scanf("%d", &n);ch = getchar();/* dispose of new-line character following number of entries */ /* could simply be getchar(); */for (i = 1; i <= n; i++) { printf("%10d%10d\n", i, i * i);if (i % 24 == 0) {printf("Press Enter to continue...");ch = getchar(); /* or simply getchar(); */}}return 0;}5. [was #10]#include <ctype.h>#include <stdio.h>int main(void){int sum = 0;char ch;printf("Enter a word: ");while ((ch = getchar()) != '\n')switch (toupper(ch)) {case 'D': case 'G':sum += 2; break;case 'B': case 'C': case 'M': case 'P':sum += 3; break;case 'F': case 'H': case 'V': case 'W': case 'Y': sum += 4; break;case 'K':sum += 5; break;case 'J': case 'X': sum += 8; break;case 'Q': case 'Z': sum += 10; break;default: sum++; break;}printf("Scrabble value: %d\n", sum);return 0;}6. [was #12]#include <stdio.h> int main(void){printf("Size of int: %d\n", (int) sizeof(int)); printf("Size of short: %d\n", (int)sizeof(short));printf("Size of long: %d\n", (int) sizeof(long)); printf("Size of float: %d\n", (int)sizeof(float));printf("Size of double: %d\n", (int) sizeof(double));printf("Size of long double: %d\n", (int) sizeof(long double));return 0;}Since the type of a sizeof expression may vary from one implementation to another, it's necessary in C89 to cast sizeof expressions to a known type before printing them. The sizes of the basic types are small numbers, so it's safe to cast them to int. (In general, however, it's best to cast sizeof expressions to unsigned long and print them using %lu.) In C99, we can avoid the cast by using the %zu conversion specification.Chapter 8Answers to Selected Exercises1. [was #4] The problem with sizeof(a) / sizeof( t) is that it can't easily be checked for correctness by someone reading the program. (The reader would have to locate the declaration of a and makesure that its elements have type t .)2. [was #8] To use a digit d (in character form) as a subscript into thearray a, we would write a[d-'0']. This assumes that digits have consecutive codes in the underlying character set, which is true of ASCII and other popular character sets.7. [was #10]const int segments[10][7] = {{1, 1, 1, 1, 1, 1},{0, 1, 1},{1, 1, 0, 1, 1, 0, 1},{1, 1, 1, 1, 0, 0, 1},{0, 1, 1, 0, 0, 1, 1},{1, 0, 1, 1, 0, 1, 1},{1, 0, 1, 1, 1, 1, 1},{1, 1, 1},{1, 1, 1, 1, 1, 1, 1},{1, 1, 1, 1, 0, 1, 1}};Answers to Selected Programming Projects2. [was #2]#include <stdio.h> int main(void){int digit_count[10] = {0};int digit;long n;printf("Enter a number: "); scanf("%ld", &n);while (n > 0) { digit = n % 10; digit_count[digit]++; n /= 10;}printf ("Digit: ");for (digit = 0; digit <= 9; digit++) printf("%3d", digit);printf("\nOccurrences:");for (digit = 0; digit <= 9; digit++) printf("%3d", digit_count[digit]);printf("\n");return 0;}5. [was #6]#include <stdio.h> #define NUM_RATES ((int) (sizeof(value) / sizeof(value[0]))) #define INITIAL_BALANCE 100.00 int main(void){int i, low_rate, month, num_years, year; double value[5];printf("Enter interest rate: "); scanf("%d", &low_rate); printf("Enter number of years: "); scanf("%d", &num_years);printf("\nYears");for (i = 0; i < NUM_RATES; i++) { printf("%6d%%", low_rate + i); value[i] =INITIAL_BALANCE;} printf("\n");for (year = 1; year <= num_years; year++) { printf("%3d ", year);for (i = 0; i < NUM_RATES; i++) {for (month = 1; month <= 12; month++)value[i] += ((double) (low_rate + i) / 12) / 100.0 * value[i]; printf("%7.2f",value[i]);} printf("\n");}return 0;}8. [was #12]#include <stdio.h>#define NUM_QUIZZES 5#define NUM_STUDENTS 5int main(void){int grades[NUM_STUDENTS][NUM_QUIZZES];int high, low, quiz, student, total;for (student = 0; student < NUM_STUDENTS; student++) { printf("Enter grades for student %d: ", student + 1);for (quiz = 0; quiz < NUM_QUIZZES; quiz++) scanf("%d", &grades[student][quiz]);}printf("\nStudent Total Average\n");for (student = 0; student < NUM_STUDENTS; student++) { printf("%4d ", student +1);total = 0;for (quiz = 0; quiz < NUM_QUIZZES; quiz++)total += grades[student][quiz];printf("%3d %3d\n", total, total / NUM_QUIZZES);}printf("\nQuiz Average High Low\n");for (quiz = 0; quiz < NUM_QUIZZES; quiz++) {printf("%3d ", quiz + 1);total = 0;high = 0;low = 100;for (student = 0; student < NUM_STUDENTS; student++) { total +=grades[student][quiz];if (grades[student][quiz] > high)high = grades[student][quiz];if (grades[student][quiz] < low)low = grades[student][quiz];}printf("%3d %3d %3d\n", total / NUM_STUDENTS, high, low); }return 0;}Chapter 9Answers to Selected Exercises2. [was #2]int check(int x, int y, int n){return (x >= 0 && x <= n - 1 && y >= 0 && y <= n - 1); }4. [was #4] int day_of_year(int month, int day, int year) {int num_days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int day_count = 0, i;for (i = 1; i < month; i++)day_count += num_days[i-1];/* adjust for leap years, assuming they are divisible by 4 */if (year % 4 == 0 && month > 2)day_count++;return day_count + day;}Using the expression year %4 == 0 to test for leap years is not completely correct. Centuries are special cases: if a year is a multiple of 100, then it must also be a multiple of 400 in order to be a leap year. The correct test is year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)6. [was #6; modified]int digit(int n, int k){int i;for (i = 1; i < k; i++)n /= 10;return n % 10;}8. [was #8] (a) and (b) are valid prototypes. (c) is illegal, since it doesn't specify the type of the parameter. (d) incorrectly specifies that f returns an int value in C89; in C99, omitting the return type is illegal.10. [was #10](a)int largest(int a[], int n){int i, max = a[0];for (i = 1; i < n; i++)if (a[i] > max) max = a[i];return max;}(b)int average(int a[], int n){int i, avg = 0;for (i = 0; i < n; i++)avg += a[i];return avg / n;}(c)int num_positive(int a[], int n){int i, count = 0;for (i = 0; i < n; i++) if (a[i] > 0) count++;return count;}15. [was #12; modified]double median(double x, double y, double z) {double result;if (x <= y)if (y <= z) result = y; else if (x <= z) result = z; else result = x; else {if (z <= y) result = y; else if (x <= z) result = x; else result = z;return result;}17. [was #14]int fact(int n){int i, result = 1;for (i = 2; i <= n; i++)result *= i;return result;}19. [was #16] The following program tests the pb function: #include <stdio.h> void pb(int n);int main(void){int n;printf("Enter a number: "); scanf("%d", &n);printf("Output of pb: "); pb(n);printf("\n");return 0;}void pb(int n){if (n != 0) {pb(n / 2); putchar('0' + n % 2);}}pb prints the binary representation of the argument n, assuming that nis greater than 0. (We also assume that digits have consecutive codes in the underlying character set.) For example:Enter a number: 53 Output of pb: 110101A trace of pb's execution would look like this:pb(53) finds that 53 is not equal to 0, so it calls pb(26), which finds that 26 is not equal to 0, so it calls pb(13), which finds that 13 is not equal to 0, so it callspb(6), which finds that 6 is not equal to 0, so it calls pb(3), which finds that 3 is not equal to 0, so it callspb(1), which finds that 1 is not equal to 0, so it callspb(0), which finds that 0 is equal to 0, soit returns, causingpb(1) to print 1 and return, causing pb(3) to print 1 and return, causing pb(6) to print 0 and return, causing pb(13) to print 1 andreturn, causing pb(26) to print 0 and return, causingpb(53) to print 1 and return.Chapter 10Answers to Selected Exercises1. [was #2] (a) a, b, and c are visible.(b) a, and d are visible.(c) a, d, and e are visible.(d) a and f are visible.Answers to Selected Programming Projects3. [was #4]#include <stdbool.h> /* C99 only */#include <stdio.h>#include <stdlib.h>#define NUM_CARDS 5#define RANK 0#define SUIT 1 /* external variables */ int hand[NUM_CARDS][2];/* 0 10 | ___ | ___1 | ___ | ___2 | ___ | ___3 | ___ | ___4 | ___ | ___rank suit*/ bool straight, flush, four, three; int pairs; /* can be 0, 1, or 2 */ /* prototypes */void read_cards(void);void analyze_hand(void);void print_result(void); /*********************************************************** main: Calls read_cards, analyze_hand, and print_result * repeatedly. ***********************************************************/ int main(void){for (;;) {read_cards();analyze_hand();print_result();}}/*********************************************************** read_cards: Reads the cards into the external variable* hand; checks for bad cards and duplicate ** cards. * **********************************************************/ void read_cards(void) {char ch, rank_ch, suit_ch; int i, rank, suit;bool bad_card, duplicate_card; int cards_read = 0;while (cards_read < NUM_CARDS) { bad_card = false;printf("Enter a card: ");rank_ch = getchar();switch (rank_ch) {case '0': exit(EXIT_SUCCESS);case '2': rank = 0; break;case '3': rank = 1; break;case '4': rank = 2; break;case '5': rank = 3; break;case '6': rank = 4; break;case '7': rank = 5; break;case '8': rank = 6; break;case '9': rank = 7; break;case 't': case 'T': rank = 8; break; case 'j': case 'J': rank = 9; break; case 'q':case 'Q': rank = 10; break; case 'k': case 'K': rank = 11; break; case 'a': case 'A': rank = 12; break; default: bad_card = true;}suit_ch = getchar();switch (suit_ch) {case 'c': case 'C': suit = 0; break; case 'd': case 'D': suit = 1; break; case 'h':case 'H': suit = 2; break; case 's': case 'S': suit = 3; break; default: bad_card = true;}while ((ch = getchar()) != '\n') if(ch != ' ') bad_card = true;if (bad_card) {printf("Bad card; ignored.\n");continue;}duplicate_card = false;for (i = 0; i < cards_read; i++)if (hand[i][RANK] == rank && hand[i][SUIT] == suit) { printf("Duplicate card;ignored.\n"); duplicate_card = true;break;}if (!duplicate_card) {hand[cards_read][RANK] = rank; hand[cards_read][SUIT] = suit;cards_read++;}}}/*********************************************************** analyze_hand: Determines whether the hand contains a* straight, a flush, four-of-a-kind, ** and/or three-of-a-kind; determines the ** number of pairs; stores the results into ** the external variables straight, flush, ** four, three, and pairs. ***********************************************************/ void analyze_hand(void){int rank, suit, card, pass, run;straight = true; flush = true; four = false; three = false; pairs = 0;/* sort cards by rank */for (pass = 1; pass < NUM_CARDS; pass++)for (card = 0; card < NUM_CARDS - pass; card++) { rank = hand[card][RANK];suit = hand[card][SUIT];if (hand[card+1][RANK] < rank) { hand[card][RANK] = hand[card+1][RANK];hand[card][SUIT] = hand[card+1][SUIT]; hand[card+1][RANK] = rank;hand[card+1][SUIT] = suit;}}/* check for flush */suit = hand[0][SUIT];for (card = 1; card < NUM_CARDS; card++) if (hand[card][SUIT] != suit) flush = false;/* check for straight */for (card = 0; card < NUM_CARDS - 1; card++)if (hand[card][RANK] + 1 != hand[card+1][RANK]) straight = false;/* check for 4-of-a-kind, 3-of-a-kind, and pairs by looking for "runs" of cards with identical ranks */ card = 0;while (card < NUM_CARDS) {rank = hand[card][RANK];run = 0;do {run++; card++;} while (card < NUM_CARDS && hand[card][RANK] == rank); switch (run) { case 2: pairs++; break;case 3: three = true; break;case 4: four = true; break;}}}/*********************************************************** print_result: Prints the classification of the hand, ** based on the values of the external ** variables straight, flush, four, three, ** and pairs. ***********************************************************/ void print_result(void){if (straight && flush) printf("Straight flush");else if (four) printf("Four of a kind");else if (three &&pairs == 1) printf("Full house");printf("Flush"); printf("Straight"); printf("Three of a kind"); else if (pairs == 2) printf("Two pairs"); else if (pairs == 1)printf("Pair"); else printf("High card"); printf("\n\n");}5. [was #6]#include <stdbool.h> /* C99 only */#include <stdio.h>#include <stdlib.h> #define NUM_RANKS 13#define NUM_SUITS 4#define NUM_CARDS 5/* external variables */int num_in_rank[NUM_RANKS]; int num_in_suit[NUM_SUITS]; bool straight, flush, four, three; int pairs; /* can be 0, 1, or 2 */ /* prototypes */void read_cards(void); void analyze_hand(void);void print_result(void);/*********************************************************** main: Calls read_cards, analyze_hand, and print_result* repeatedly. * **********************************************************/ int main(void) {for (;;) {read_cards(); analyze_hand();print_result();}}/*********************************************************** read_cards: Reads the cards into the external* variables num_in_rank and num_in_suit;* checks for bad cards and duplicate cards.********************************************************** void read_cards(void) {bool card_exists[NUM_RANKS][NUM_SUITS]; char ch, rank_ch, suit_ch; int rank, suit;bool bad_card;int cards_read = 0;for (rank = 0; rank < NUM_RANKS; rank++) { num_in_rank[rank] = 0;for (suit = 0; suit < NUM_SUITS; suit++) card_exists[rank][suit] = false;}else if (flush)else if (straight) else if (three)for (suit = 0; suit < NUM_SUITS; suit++) num_in_suit[suit] = 0;while (cards_read < NUM_CARDS) { bad_card = false;printf("Enter a card: ");rank_ch = getchar();switch (rank_ch) {case '0': exit(EXIT_SUCCESS);case '2': rank = 0; break;case '3': rank = 1; break;case '4': rank = 2; break;case '5': rank = 3; break;case '6': rank = 4; break;case '7': rank = 5; break;case '8': rank = 6; break;case '9': rank = 7; break;case 't': case 'T': rank = 8; break; case 'j': case 'J': rank = 9; break; case 'q': case 'Q': rank = 10; break;case 'k': case 'K': rank = 11; break;case 'a': case 'A': rank = 12; break; default: bad_card = true;}suit_ch = getchar(); switch (suit_ch) {case 'c': case 'C': suit = 0; break;case 'd': case 'D': suit = 1; break;case 'h': case 'H': suit = 2; break;case 's': case 'S': suit = 3; break; default: bad_card = true;}while ((ch = getchar()) != '\n') if(ch != ' ') bad_card = true;if (bad_card) printf("Bad card; ignored.\n");else if (card_exists[rank][suit]) printf("Duplicate card; ignored.\n");else { num_in_rank[rank]++; num_in_suit[suit]++; card_exists[rank][suit] = true;cards_read++;}}} /*********************************************************** analyze_hand: Determines whether the hand contains a* straight, a flush, four-of-a-kind, *。
现代设计方法第1阶段练习题江大考试题库及答案一科共有三个阶段,这是其中一个阶段。答案在最
![现代设计方法第1阶段练习题江大考试题库及答案一科共有三个阶段,这是其中一个阶段。答案在最](https://img.taocdn.com/s3/m/19dd489b6edb6f1afe001f7d.png)
江南大学网络教育第一阶段练习题考试科目:《现代设计方法》第章至第章(总分100分)__________学习中心(教学点)批次:层次:专业:学号:身份证号:姓名:得分:一单选题 (共17题,总分值17分,下列选项中有且仅有一个选项符合题目要求,请在答题卡上正确填涂。
)1. 对于多元函数的无约束优化问题,判断其最优点可以根据()。
(1 分)A. 目标函数的梯度判定B. 目标函数的性态判定C. 目标函数的凹凸性判定D. 目标函数值的大小判定2. 如果两个随机变量A和B均服从正态分布,即A=N(100,0.05),B=N(200,0.02),则随机变量A在 0.05之间分布的百分数与随机变量B在 0.02之间分布的百分数()。
(1 分)A. 之比为2.5B. 之差为0.5C. 之比为0.4D. 相等3. 决定正态分布曲线形状的参数是()。
(1 分)A. 正态变量B. 均值和标准差C. 均值D. 标准差4. 多元函数F(X)在X*处存在极大值的充分必要条件是:在X*处的Hessian矩阵()。
(1分)A. 等于零B. 大于零C. 负定D. 正定5. 对于函数F(x)= ,从初始点x(0)={1,1}T出发,沿方向s(0)={-1,-2}T进行一维搜索,最优步长因子为()。
(1 分)A. 10/16B. 5/9C. 9/34D. 1/26. 根据强度—应力干涉理论,可以判定,当强度均值μr大于应力均值μs时,则零件可靠度R的值()。
(1 分)A. 小于0.5B. 等于0.5C. 大于0.5D. 等于17. 图示三角形单元非节点载荷的节点等效载荷为()。
(1 分)A. F yi=-100KN F yj=-50KN F yk=0B. F yi=-80KN F yj=-70KN F yk=0C. F yi=-70KN F yj=-80KN F yk=0D. F yi=-50KN F yj=-100KN F yk=08. 在有限元分析中,划分单元时,在应力变化大的区域应该()。
全国7月(02200)现代设计方法练习题及答案之欧阳数创编
![全国7月(02200)现代设计方法练习题及答案之欧阳数创编](https://img.taocdn.com/s3/m/6b240272d1f34693dbef3ea7.png)
全国2011年7月高等教育自学考试考前练习题时间:2021.03.02 创作:欧阳数现代设计方法(课程代码:02200)一、单项选择题(本大题共20小题,每小题1分,共20分)1.数字化仪在早期CAD作业中经常使用,它是一种()A.输入设备B.输出设备C.存储设备D.绘图设备2.滚筒式绘图仪一般采用插补原理进行绘图,但在绘图过程中有时不需要插补。
绘制以下方向的线段时需要插补的是()A.X方向线段B.Y方向线段C.±45o方向线段 D.一般方向线段3.在采用Cohen—Sutherland编码裁剪算法剪裁线段时,如果一条线段跨越两个区,则当其两端点编码的逻辑乘为零时,则该线段( )A.全部可见B.全部不可见C.部分可见D.不确定4.在消隐处理中,当进行平面可见性测试时,若平面的法线矢量和视线矢量的夹角大于90o,则该面()A.可见B.不可见C.部分可见D.不确定5.一逐行扫描光栅显示器的水平扫描频率为15600H Z,垂直扫描频率为50H Z,则该显示器()A.水平方向有15600个像素点B.垂直方向有312条水平扫描线C.一条水平扫描线上有312个像素点D.垂直方向上有50条扫描线6.F(x)为单值、连续、可微且无约束的一元函数,则在点x=x*处有极大值的充分条件是()A.B.C.D.7.外点罚函数法的特点是()A.适合处理等式约束的最优化问题B.探索过程在可行域内进行C.适合处理不等式约束的最优化问题D.需要先求出初始内点8.在单峰搜索区间[a,b]内任取两点a1、a2,若函数值F(a1)=F(a2),则缩小后的区间为()A.[a,a1]B.[a1,b]C.[a1,a2]D.[a,a2]9.以下关于函数的梯度的说法不正确的是()A.函数的梯度是标量B.函数值沿梯度方向变化最剧烈C.函数的梯度是矢量D.求函数的极小值时常沿负梯度方向搜索10.多元函数F(x)在点X*附近一阶偏导数连续,则该点为极大值点的充分条件为()A .F(x*)=0B. F(x*)=0,H(x *)正定C.F(x*)=0D.F(x*)=0,H(x*)负定11.平面桁架结构中,某单元局部编码依次对应的总体编码为8,6,则单元则度矩阵中的元素k34应放入总体刚度矩阵[K]中的()A.16行15列B.11行12列C.12行16列D.11行15列12.平面三解形单元的刚度矩阵阶数为()A.2×2B.3×3C.4×4D.6×613.平面刚架结构中的杆单元,单元中的位移分量个数为()A.3B.6C.9D.1214.平面问题的弹性矩阵与材料的()A.弹性模量和硬度有关B.弹性模量和泊松比有关C.弹性模量和强度有关D.强度和泊松比有关15.若把平面应力问题的弹性矩阵改成平面应变问题的弹性矩阵,只需将()/(1)A.换成/(1),换成/(1)B.换成/(1),换成(1)C.换成/(1),换成/(1)D.换成/(1),换成(1)16.2/3表决系统中各子系统的寿命均服从指数分布,且失效率均为,则该表决系统的平均寿命为()A.B.C.D.17.图示由7个子系统组成的复杂系统,各子系统的可靠度均为R,则该系统的可靠度为()A.B.C.D.18.为了检查灯炮的质量,抽取100只灯泡进行试验,灯泡工作到100小时有30只损坏,工作到150小时又有20只损坏,从100小时到150小时这段时间灯泡的平均失效密度为()A.0.004B.0.006C.0.2D.0.519.电器元件(系统)的失效密度函数一般服从()A.正态分布B.指数分布C.威布尔分布D.对数正态分布20.当强度和应力的均值相等时,零件的可靠度()A.大于50%B.小于50%C.等于50%D.难以确定二、多项选择题(本大题共5小题,每小题2分,共10分)21.固定窗口大小和位置不变,改变视区的有关参数,可以实现显示图形的()A.放大B.缩小C.左右移动D.上下移动E.扭曲22.计算机软件是实现CAD各项技术功能的核心,软件是指与计算机系统操作使用有关的()A.程序B.规程C.规则D.设计说明书E.使用说明书23.求解无约束问题的主要方法有()A.Powell法B.单纯形法C.梯度法D.复合形法E.简约梯度法24.对平面刚架结构的单元刚度矩阵有影响的因素为()A.杆件长度B.杆件材料的强度C.杆件的横截尺寸D.杆件横截面的对称性E.杆件横截面在结构中的方位25.正态分布中的均值()A.表征随机变量分布的离散程度B.表征随机变量分布的集中趋势C.决定正态分布曲线的位置D.决定正态分布曲线的形状E.影响正态分布曲线的对称性三、填空题(本大题共10小题,每小题1分,共10分)26.输入设备的主要作用是将字符、平面上或空间中点的坐标值输入计算机中,其基本功能是。
c语言程序设计:现代方法(习题答案)
![c语言程序设计:现代方法(习题答案)](https://img.taocdn.com/s3/m/e0f49ea164ce0508763231126edb6f1aff0071f2.png)
勘误内容补充说明2010-09-29旸谷全书的st dio.h文件名中间的.都应该是半角的后面无空格。
P63第14-15行,应缩进两个英文字母,代码段改为:if(line_num== MA X_LIN E) {line_num= 0;page_num++;}第22-26行应为:i f (li ne_nu m ==MAX_L INE){l ine_n um =0;p age_n um++;} 第29-33行应该为:if (l ine_n um == MAX_LINE){ line_num = 0; page_num++;}第36-40行应该为:if (l ine_n um == MAX_LINE){ line_num = 0; page_num++;}P70倒数第4行前去掉项目符号,应该为代码行,且在{前另起一行。
P74第18行和第29行的print f语句中,i前面漏掉一个,号。
P75第14行的prin tf语句中,i前面漏掉一个,号。
P82第7行的/*签名的分号应该在*/的后面。
P120倒数第12行的:应为=。
P126正数第14行的is R1LLY应该是15 R1LLY。
P133正数第7行的b后面漏一个分号。
倒数第8行的pr intf语句中的if应为is。
P134第2行的prin tf语句括号前多一个空格,括号中的:应为!。
P158第一个代码段中倒数第3和4行的p rintf语句结尾的分号前多一个空格。
P173中间代码段的三行,每一条语句后面都漏了一个分号。
P176第一段代码第一行的最后多一个;。
第24行的结尾分号前多一个空格。
2016现代设计方法复习资料(题+答案)
![2016现代设计方法复习资料(题+答案)](https://img.taocdn.com/s3/m/f488fda3e2bd960590c677f6.png)
现代设计方法复习题一、选择题1.在CAD 使用中,为了方便定义图形通常采用不同坐标系,在以下坐标系中,坐标系的定义域是连续且无界的是 【A 】A.世界坐标系B.显示器坐标系C.规格化设备坐标系D.绘图仪坐标系2.CAD 系统中不是按其存储内容的特征划分的几何模型 【 D 】A.线框几何模型B.表面几何模型C.实体几何模型D.曲面几何模型3.在单峰搜索区间[x1, x3](x1<x3)内,取一点x2,用二次插值法计算得x4(在[x1,x3]内,若x2>x4,并且函数F(x4)>F(x2),则取新区间为 【 D 】A. [x1, x4]B. [x2, x3]C. [x1, x2]D. [x4, x3]4. 函数F(X)为在区间[10,30]内有极小值的单峰函数,进行一维搜索时,取两点15和20,若F(15)<F(20),则缩小后的区间为 【 B 】A .[15,20]B .[10,20]C .[20,30]D .[15,30]5. 一个多元函数F(x )在点x *附近偏导数连续,则该点为极小点的充分条件是 【 B 】A.0*)(=∇x FB.0*)(=∇x F ,H(x *)正定C. H(x *)=0D.0*)(=∇x F ,H(x *)负定6. 求解无约束优化问题的算法不包括 【 D 】A .梯度法B .鲍威尔法C .变尺度法D .罚函数法7. 梯度法与变尺度法所具有的收敛性分别为 【C 】A .一次收敛性.一次收敛性B .二次收敛性.二次收敛性C .一次收敛性.二次收敛性D .二次收敛性.一次收敛性8. 函数222),(1323121+-+=x x x x x F 在点T x }1,1{=处的梯度是 【A 】 A.T }3,4{ B.T }1,8{ C.T }12,1{ D.T }12,4{9.设F(X)为区间(0,3)上的单峰函数,且F(1)=2、F(2)=2.5,则可将搜索区间(0,3)缩小为【A 】A .(0,2)B .(1,2)C .(2,3)D .(1, 3)10. 以下因素对有限元分析的结果的精度没有影响的是 【C 】A.单元的尺寸B.单元的类型C.计算机的速度D.计算机位数11.关对于 n 维正定二次函数,沿一组共轭方向依次作一维搜索,当达到极值点时,最多需要搜索 【 B 】A .n +1 次B .n 次C .n -1次D .2n 次12.设试验数为N 0,累积失效数为N f (t),仍正常工作数N s (t),则存活频率是指 【B 】A .0)(N t N f B .0)(N t N s C .)()(t N t N f s D .)()(t N t N s f 13.世界坐标系、设备坐标系、规格化坐标系的转换关系是 【C 】A .WC→DC→NDCB .NDC→DC→WCC .WC→NDC→DCD .DC→WC→NDC14.设X =(X 1, X 2,…, X n ),R n 为维欧氏空间,则下述正确的是 【A 】A .设计空间是 n 维欧氏空间R nB .设计空间是 n 维欧氏空间R n 中落在可行域内的部分C .设计变量在具体设计问题中的迭代值是唯一的D .设计变量是指设计对象中用到的所有变量15.平面问题的弹性矩阵与材料的 【D 】A.弹性模量有关,泊松比无关B.弹性模量无关,泊松比有关C.弹性模量和泊松比都无关D.弹性模量和泊松比都有关16.标准正态分布是定义为 【C 】A.μ=1,σ=0.5的正态分布B.μ=1,σ=1的正态分布C.μ=0,σ=1的正态分布D.μ=0.5,σ=1的正态分布17.设计体积450cm 3的圆柱形包装盒,按用料最省的原则要确定其高度H 和直径D ,其设计变量是 【B 】A.重量B.直径C.面积D.体积18.已知变换矩阵⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=100020001T ,则图形将在 【B 】 A .X 方向放大2倍 B .Y 方向放大2倍C .X 方向平移2D .Y 方向平移219. 参数化绘图在定义图形时关键是利用了图形的 【 A 】A .相似性B .多样性C .个别性D .特殊性20.N 台具有相同可靠度为R 的设备组成系统,恰好有r 台设备失效时系统的可靠度为 【C 】A .RS =∑=--r i r r n r n R R C)1( B .RS =∑=--n i r r n r n R R C 0)1( C .RS =r r n rn R R C )1(-- D .RS =∑=---ri r r n r n R R C 0)1(121.三维几何造型是CAD 的一种 【A 】A.图形处理技术B.工程分析技术C.文档处理技术D.软件设计技术22.下列设备不属于CAD 作业输出设备的,有 【D 】A .打印机B .绘图仪C .显示器D .光笔23.三维图形变换矩阵⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡=s n m l r j i h q f e d p c b a T 中,[l m n ]表示产生 【D 】 A .比例变换 B .对称变换 C .错切变换 D .平移变换24.对于一个无约束优化问题,若其一阶、二阶偏导数易计算,且计算变量不多(n≤20),宜选用的优化方法是 【A 】A.拟牛顿法B.变尺度法C.0.618法D.二次插值法25.在单峰搜索区间[x 1, x 3](x 1<x 3)内,取一点x 2,用二次插值法计算得x 4(在[x 1,x 3]内,若x 2<x 4,并且函数F(x 4)<F(x 2),则取新区间为 【B 】A. [x1, x4]B. [x2, x3]C. [x1, x2]D. [x4, x3]26. 一个多元函数F(X)在点x*附近偏导数连续,则该点为极大点的充分条件是【D 】A.0*)(=∇x FB.0*)(=∇x F ,H(x*)正定C.H(x*)=0D.0*)(=∇x F ,H(x*)负定27. 下列特性中,梯度法不具有的是 【 A 】A.二次收敛性B.要计算一阶偏导数C.对初始点的要求不高D.只利用目标函数的一阶偏导数值构成搜索方向28. 函数222),(1323121+-+=x x x x x F 在点T x }1,1{=处的梯度是 【A 】 A.T }6,1{ B.T }1,6{ C.T }12,1{ D.T }4,1{29. 正态分布中的标准差是 【B 】A. 表征随机变量分布的集中趋势B. 表征随机变量分布的离散程度C.决定正态分布曲线的位置D.影响正态分布曲线的对称性30.用有限元方法求解问题获得的解属于 【 A 】A.近似解B.精确解C.解析解D.半解析解31.若知某产品的失效密度f(t),则其平均寿命T 可表为 【D 】A.⎰t dt t f 0)(B.⎰∞t dt t f )(C.⎰∞t dt t f t f )()(D.⎰∞0)(dt t tf 32.对于 n 维正定二次函数,沿一组共轭方向依次作一维搜索,当达到极值点时,最多需要搜索 【B 】A . n +1 次B .n 次C .n -1次D .2n 次33.以下因素对有限元分析的结果的精度没有影响的是 【C 】A.单元的尺寸B.单元的类型C.计算机的速度D.计算机位数34.某多元函数值在X (k)点满足∇F(X (k))=0,则X (k) 为 【 C 】A .鞍点B .极大值点C .极小值点D .无法判断35.求f(x 1,x 2)=2x 12-8x 1+2x 22-4x 2+20的极值及极值点。
现代设计方法习题答案
![现代设计方法习题答案](https://img.taocdn.com/s3/m/6da8916d0166f5335a8102d276a20029bd6463e3.png)
现代设计方法习题答案现代设计方法习题答案在现代设计方法的学习过程中,习题是非常重要的一环。
通过习题的解答,我们可以更好地理解和掌握设计方法的核心概念和技巧。
下面我将为大家提供一些现代设计方法习题的答案,希望能对大家的学习有所帮助。
习题一:什么是用户中心设计(User-Centered Design)?请简要描述其核心原则。
答案:用户中心设计是一种以用户为中心的设计方法,旨在满足用户的需求和期望。
其核心原则包括以下几点:1. 理解用户需求:通过调研和用户访谈等方法,深入了解用户的需求和期望,为设计过程提供指导。
2. 设计可用性:在设计过程中,注重用户体验和界面的易用性,确保用户能够轻松地理解和操作设计产品。
3. 迭代设计:设计过程是一个循序渐进的过程,需要不断地与用户进行反馈和交流,不断改进和优化设计。
4. 多学科合作:用户中心设计需要与不同领域的专家进行紧密合作,包括用户研究人员、交互设计师、视觉设计师等,以确保设计的全面性和有效性。
习题二:请解释什么是信息架构(Information Architecture),并举例说明。
答案:信息架构是指在设计过程中对信息进行组织和分类的过程。
它关注的是如何使用户能够轻松地找到所需的信息,以及如何将信息以一种有序和易于理解的方式呈现给用户。
举个例子,假设我们正在设计一个电子商务网站。
在信息架构的过程中,我们需要考虑如何将商品分类,如何将不同的商品属性进行组织和展示,以及如何设计搜索功能等。
通过合理的信息架构,用户可以快速找到所需的商品,并且能够清楚地了解每个商品的特点和价格。
习题三:请解释什么是情感设计(Emotional Design),并说明其在产品设计中的作用。
答案:情感设计是一种注重用户情感体验的设计方法。
它通过设计产品的外观、交互和功能等方面,来引发用户的情感共鸣和情感连接。
在产品设计中,情感设计起到了至关重要的作用。
它可以提升用户对产品的好感度和满意度,从而增加用户的忠诚度和购买意愿。
现代设计方法习题集及答案
![现代设计方法习题集及答案](https://img.taocdn.com/s3/m/fd3f1681f8c75fbfc77db296.png)
《现代设计方法》课程习题集【说明】:本课程《现代设计方法》(编号为02200)共有单选题,填空题1,计算题,简答题等多种试题类型,其中,本习题集中有[单选题,填空题1,计算题,简答题]等试题类型未进入。
一、单选题1.在CAD使用中,为了方便定义图形通常采用不同坐标系,在以下坐标系中,坐标系的定义域是连续且无界的是()A.世界坐标系B.显示器坐标系C.规格化设备坐标系D.绘图仪坐标系2.工程数据处理中,使用线性插值法完成()A.一元插值B.二元插值C.曲线拟合D.曲线绘制3.三维几何造型是CAD中的一种()A.图形处理技术B.工程分析技术C.文档处理技术D.软件设计技术4. CAD系统中,支撑用户进行CAD工作的通用性功能软件是()A.系统软件B.支撑软件C.专用操作软件D.专用应用软件5.若在CAD系统中,固定窗口参数,同时缩小视区高度和宽度,则视图内图形()A.比例增大B.比例缩小C.左右移动D.上下移动6. CAD系统中不是按其描述和存储内容的特征划分的几何模型()A.线框几何模型B.表面几何模型C.实体几何模型D.曲面几何模型7. 世界坐标系、设备坐标系、规格化坐标系的转换关系是( )A .WC→DC→NDCB .NDC→DC→WC C .WC→NDC→DCD .DC→WC→N DC8. 参数化绘图在定义图形时关键是利用了图形的( )A .相似性B .多样性C .个别性D .特殊性9.下列设备不属于CAD 作业输入设备的,有( )A .绘图仪B .键盘C .数字化仪D .光笔10.为使窗口—视区变换后的图形在视区中输出而不失真,则( )A .yb xl W W =ybxl V V B .yt xr W W =yt xr V VC .yb yt xl xr W W W W --=yb yt xlxr V V V V -- D .yt xr yb xl V V W W --=ytxr yb xl W W V W --11. 平面问题的弹性矩阵与材料的( )A.弹性模量有关,泊松比无关B.弹性模量无关,泊松比有关C.弹性模量和泊松比都无关D.弹性模量和泊松比都有关12. 三维图形变换矩阵⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡=s nmlr j i h q f e dp c b aT ,中l 表示产生的( ) A.比例变换 B.对称变换 C.错切变换 D.平移变换13.二维图形比例变换矩阵中⎥⎦⎤⎢⎣⎡=d a T 00,可有( ) A.a=0,d=1 B. a=1,d=0 C. a=d=1 D. a=d=014.已知变换矩阵⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=100020001T ,则图形将在( ) A .X 方向放大2倍 B .Y 方向放大2倍C .X 方向平移2D .Y 方向平移215. 三维图形变换矩阵⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎣⎡=s nmlr j i h q f e dp c b a T 中,[l m n ]表示产生( ) A .比例变换 B .对称变换 C .错切变换 D .平移变换16.一个多元函数F(X)在点x*附近偏导数连续,则该点为极小点的充分条件是( )A.0*)(=∇x FB.0*)(=∇x F ,H(x*)正定C.H(x*)=0D.0*)(=∇x F ,H(x*)负定17. 内点罚函数法的特点是( )A.能处理等式约束问题B.初始点必须在可行域内C. 初始点可以在可行域外D.后面产生的迭代点序列可以在可行域外18. 对于一个无约束优化问题,若其一阶、二阶偏导数易计算,且计算变量不多(n≤20),宜选用的优化方法是( )A.拟牛顿法B.变尺度法C.0.618法D.二次插值法19. 设计体积500cm 3的圆柱形包装盒,按用料最省的原则要确定其高度H 和直径D ,其设计变量是( )A.重量B.直径C.面积D.体积20. 多元函数F(X)在点x*附近偏导数连续,0*)(=∇x F ,H(x*)负定,则该点为F(X)的( )A.极大值点B. 极小值点C.鞍点D.不连续点21. 在单峰搜索区间[x 1, x 3](x 1<x 3)内,取一点x 2,用二次插值法计算得x 4 (在[x 1,x 3]内,若x 2>x 4,并且函数F(x 4)<F(x 2),则取新区间为( ) A. [x1, x4] B. [x2, x3] C. [x1, x2] D. [x4, x3]22.下列特性中,梯度法不具有的是( )A.二次收敛性B.要计算一阶偏导数C.对初始点的要求不高D.只利用目标函数的一阶偏导数值构成搜索方向23.对于极小化F(x),而受限于约束g μ(x)≤0(μ= 0,1,2,…,m)的优化问题,其内点罚函数表达式为( ) A.∑=-=Φmk k X g rX F rX 1)()()(/1)(),(μμ B.∑=+=Φmk k X g rX F r X 1)()()(/1)(),(μμ C.∑=-=Φmk k X g rX F r X 1)()()](,0max [)(),(μμ D.∑=-=Φmk k X g rX F r X 1)()()](,0min[)(),(μμ 24.设X =(X 1, X 2,…, X n ),R n 为维欧氏空间,则下述正确的是( )A .设计空间是 n 维欧氏空间R nB .设计空间是 n 维欧氏空间R n 中落在可行域内的部分C .设计变量在具体设计问题中的迭代值是唯一的D .设计变量是指设计对象中用到的所有变量25. 函数22),(1323121+-+=x x x x x F 在点Tx }2,1{=处的梯度是( )A. T }12,1{B.T }1,8{C. T}3,1{ D.T}8,0{26. 对于 n 维正定二次函数,沿一组共轭方向依次作一维搜索,当达到极值点时,最多需要搜索( )A .n +1 次B .n 次C .n -1次D .2n 次27. 函数F (X )为在区间[10,20]内有极小值的单峰函数,进行一维搜索时,取两点13和16,若F (13)<F (16),则缩小后的区间为( )A .[13,16]B .[10,13]C .[10,16]D .[16,20]28. 梯度法与变尺度法所具有的收敛性分别为( )A .一次收敛性.一次收敛性B .二次收敛性.二次收敛性C .一次收敛性.二次收敛性D .二次收敛性.一次收敛性29.设F (X )为区间(0,3)上的单峰函数,且F (1)=2、F (2)=1.5,则可将搜索区间(0,3)缩小为( )A .(0,2)B .(1,2)C .(2,3)D .(1,3)30. 求f(x 1,x 2)=2x 12-8x 1+2x 22-4x 2+20的极值及极值点( )A. x*=[1,1]T 12B.x*=[2,1]T 10 C. x*=[2,2]T 12 D. x*=[1,0]T 1431. 串联系统的失效模式大多服从( )A.正态分布B.对数正态分布C.指数分布D.威布尔分布32. 抽取100只灯泡进行实验,灯泡工作到50小时有12只损坏,工作到70小时有20只损坏,从50小时到70小时这段时间内灯泡的平均失效密度是( ) A.0.006 B.0.004 C.0.01 D.0.1233. 由三个相同的元件组成的并联系统,系统正常工作的条件是至少有两个元件处于正常工作状态,每个元件的可靠度为R=0.9,则系统的可靠度为( ) A.0.972 B.0.99 C.0.999 D.0.999734. 当转换开关的可靠度为1时,非工作冗余系统的可靠度为R1, 工作冗余系统的可靠度为R2,则R1与R2之间的关系为( )A. R1<R2B. R1>R2C. R1= R2D. R1≤R235. 下列可靠性指标关系式不正确的是( )A .dtt dF t f )()(= B .1)()(=+t F t R C .⎰∞=tdt t tf t R )()( D .⎰∞=0)(dt t tf T36. 正态分布中的标准差是( )A.表征随机变量分布的离散程度B.表征随机变量分布的集中趋势C.决定正态分布曲线的位置D.影响正态分布曲线的对称性37.若知某产品的失效密度f(t),则其平均寿命T 可表为( )A.⎰t dt t f 0)( B.⎰∞tdt t f )( C.⎰∞tdt t f t f )()( D.⎰∞)(dt t tf38.随机变量A 和B 均服从正态分布,即A=N(μ1,σ1);A=N(μ2,σ2),则随机变量A在(μ1-2σ1)~(μ1-σ1)之间分布的百分数与随机变量B 在(μ2+σ2)~(μ2+2σ2)之间分布的百分数( )A.之比为-σ1/σ2B.之比为σ1/σ2C.之比为-σ2/σ1D.相等39. 标准正态分布是定义为( )A.μ=1,σ=0.5的正态分布B.μ=1,σ=1的正态分布C.μ=0,σ=1的正态分布D.μ=0.5,σ=1的正态分布40. 零件的强度和应力均服从正态分布,即N(μr ,σr ); N(μs ,σs ),且知μr >μs ,当σr 增大时,零件的可靠度( )A.提高B.降低C.不变D.不定41. 某产品的寿命服从指数分布,若知其失效率λ=0.002,则该产品的平均寿命为( )A.200B.1000C.500D.200042. 要提高可靠性的置信度,不应( )A.增加强度的样本容量B.加大强度的标准差C.减少应力的均值D.增加应力的样本容量43.N 台具有相同可靠度为R 的设备组成系统,若系统允许 r 台设备失效仍认为正常工作,则该系统的可靠度函数R S 为( ) A .R S =∑=---nri iin i n n R R C )1( B .R S =∑=--ni r rn r n R RC)1(C .R S =rr n r nR R C )1(-- D .R S =∑=---ri r rn r n R RC)1(144.N 台具有相同可靠度为R 的设备组成系统,若系统允许 r 台设备失效仍认为正常工作,则该系统的可靠度函数R S 为( ) A .R S =∑=---nri iin i n n R R C )1( B .R S =∑=--ni r rn r n R RC)1(C .R S =rr n r nR R C )1(-- D .R S =∑=---ri r rn r n R RC)1(145. 对于2/3表决系统,下列情况中,系统不能正常工作的是( )A .a 、b 失效,c 正常B .a 失效,b 、c 正常C .a 、b 、c 正常D .a 、b 正常,c 失效46.N 台具有相同可靠度为R 的设备组成系统,恰好有r 台设备失效时系统的可靠度为( ) A .R S =∑=--ri rr n r n R R C 0)1( B .R S =∑=--ni r rn r n R RC)1( C .R S =rrn r n R R C )1(-- D .R S =∑=---ri r rn r n R RC)1(147. 根据强度—应力干涉理论可以判定,当强度均值 r 等于应力均值s 时,则零件可靠度R 的值( )A .小于0.5B .大于0.5C .等于0.5D .等于148.N 个产品进行可靠性试验,在t ~t +△t 时间内的失效数为N f (t ),t 时刻的累积失效数N f (t ),则t 时刻的存活频率为( )A .Nt N N f )(- B .Nt N f )( C .t N t N f ∆∆)( D .t t N N t N ff ∆∆)]([)(-49.在t ~t +△t 的时间间隔内的平均失效密度f (t )表示( )A .平均单位时间的失效频数B .平均单位时间的失效频率C .产品工作到t 时刻,单位时间内发生失效的概率D .产品工作到t 时刻,单位时间内发生的失效数与仍在正常工作的数之比50.设试验数为N 0,累积失效数为N f (t),仍正常工作数N s (t),则存活频率是指( )A .0)(N t N f B .0)(N t N s C .)()(t N t N f s D .)()(t N t N s f二、填空题1 51.计算机辅助设计(CAD)是指人们在计算机的辅助下,对产品或工程进行设计、绘图、分析计算或编写技术文件以及显示、输出的一种设计方法。
现代设计方法部分习题与答案
![现代设计方法部分习题与答案](https://img.taocdn.com/s3/m/e441830ea200a6c30c22590102020740be1ecd6d.png)
现代设计⽅法部分习题与答案第1章1.何谓产品⽣命周期,简述其各个阶段。
产品⽣命周期(Product Life Cycle),简称PLC,是指产品的市场寿命,即⼀种新产品从开始进⼊市场到被市场淘汰的整个过程。
PLC分为介绍期(Introduc- tion)、增长期(Growth)、成熟期(Mature)、衰退期(Decline)四个阶段.2.简述现代设计所指的理论与⽅法有哪些。
3.简述产品开发的⼀般流程。
产品基本开发流程的6个阶段:阶段0,计划:规划经常被作为“零阶段”是因为它先于项⽬的达成和实际产品开发过程的启动。
阶段1,概念开发:概念开发阶段的主要任务是识别⽬标市场的需要,产⽣并评估可替代的产品概念,为进⼀步开发选择⼀个概念。
阶段2,系统⽔平设计:系统⽔平设计阶段包括产品结构的定义、产品⼦系统和部件的划分阶段3,细节设计:细节设计阶段包括产品的所有⾮标准部件及从供应商处购买的标准部件的尺⼨、材料和公差的完整明细表,建⽴流程计划并为每⼀个即将在⽣产系统中制造的部件设计⼯具。
阶段4,测试和改进:测试和改进阶段包括产品的多个⽣产前版本的构建和评估。
阶段5,产品推出:在产品推出阶段,使⽤规划⽣产系统制造第2章1.简述功能分析法的设计步骤。
总功能分析、功能分析、功能元求解、求系统原理、解求最佳系统原理⽅案。
2. 什么是技术系统?举例说明技术系统应具有的分功能单元。
技术系统所具有的功能,是完成技术过程的根本特性。
从功能的⾓度分析,技术系统应具有下列能完成不同分功能的单元:①作业单元,完成转换⼯作;②动⼒单元,完成能量的转换、传递与分配;③控制单元,接受、处理和输出控制信息;④检测单元,检测技术系统各种功能的完成情况,反馈给控制单元;⑤结构单元,实现系统各部分的连接与⽀承切削加⼯中⼼的功能构成第3章1. 产品创新的概念是什么?产品创新在哪些诱导机制下完成的,举例说明。
产品创新:新产品在经济领域⾥的成功运⽤,包括对现有⽣产要素进⾏组合⽽形成新的产品的活动。
(完整版)现代设计方法_习题集(含答案)
![(完整版)现代设计方法_习题集(含答案)](https://img.taocdn.com/s3/m/2e4c5b579ec3d5bbfd0a74de.png)
《现代设计方法》课程习题集 西南科技大学成人、网络教育学院 版权所有习题【说明】:本课程《现代设计方法》(编号为09021)共有单选题,计算题,简答题, 填空题等多种试题类型,其中,本习题集中有[ 填空题,单选题]等试题类型未进入。
一、计算题1. 用黄金分割法求解以下问题(缩小区间三次)。
342)(m in 2+-=x x x f ,给定初始区间[][]3,0,=b a ,取1.0=ε。
2. 用黄金分割法求解以下问题(缩小区间三次)32)(m in 2+=x x f ,给定[][],1,2a b =-,取1.0=ε3. 用黄金分割法求解以下问题(缩小区间三次)432+=x )x (f min ,给定[][]40,b ,a =,取10.=ε。
4. 用黄金分割法求解以下问题(缩小区间三次)。
12)(m in 3+-=x x x f ,给定初始区间[][]3,0,=b a ,取5.0=ε5. 用黄金分割法求解以下问题(缩小区间三次)。
107)(m in 2+-=x x x f ,给定初始区间[][]3,0,=b a ,取1.0=ε6. 用梯度法求解无约束优化问题:168)(m in 22221+-+=x x x X f ,取初始点[]TX 1,1)0(= ,计算精度1.0=ε。
7. 用梯度法求解96)(m in 12221+-+=x x x X f ,[]TX 1,1)0(= ,1.0=ε。
8. 用梯度法求解44)(m in 22221+-+=x x x X f ,[]TX 1,1)0(=,1.0=ε 。
9. 用梯度法求解无约束优化问题:1364)(m in 222121+-+-=x x x x X f ,取初始点[]TX 1,1)0(=,计算精度1.0=ε。
10. 用梯度法求解1212221422)(m in x x x x x X f --+=,[]TX 1,1)0(=,1.0=ε 。
(请迭代两次)11. 有三个可靠度均为0.9的子系统组成的并联系统,试比较纯并联及2/3[G]表决系统的可靠度。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
现代设计方法作业第五章相似设计与模块化设计一、就某机电、家具、家电产品,谈谈如何进行模块化设计?答:模块化设计是近年来发达国家普遍采用的一种先进设计方法,它的核心思想是将系统按功能分解为若干模块,通过模块的不同组合,可以得到不同品种、不同规格的产品。
而数控机床结构的特点也决定了模块化设计方法对于数控机床设计的适用性:1)同一类型的数控机床均可划分为基本相同的若干部分;2)同一类型的数控机床通过一个或若干个基本参数的变化形成不同规格的;3)同一类的数控机床尽管有着各种不同的结构布局和用途X围,但其基本控制、运动功能和工作原理是相同的;4)数控机床中有不少独立的功能单元,如导轨副、丝杠副、冷却系统、润滑系统、液压系统、气动系统、电气控制系统等。
这一特点使其适应于模块化设计方法;5)数控机床的加工要求向高速、高精度方向发展,要求机床结构具有高刚度、高可靠性,机床基础大件(床身、工作台、主轴箱、滑鞍、立柱等) 的结构动、静态特性和传动系统的高刚性成为设计的主要矛盾;6)数控机床采用计算机控制技术,使机床的机械传动机构大为简化;7)市场竞争和市场需求的多变,要求数控机床产品规格和功能多样化、性能好、成本低、制造周期短;8) 随着技术的进步和市场的发展,许多数控机床功能部件已实现专业化生产和商品化。
对于数控机床而言,模块化设计是指将机床上同一功能的单元,设计成具有不同用途或性能的、可以互换选用的模块,用以更好地满足用户需要的一种设计方法。
数控机床的整体结构可以分解为单个部件的有机组合。
通过功能分析,使得功能相同或相似,联接接口相同,而性能、用途不同的各种功能单元,经过选择、优化、简化和统一,形成各种具有独立功能的单元模块。
通过对机床单元模块选择、使模块间有机地匹配与连接,进而组合成各种通用机床、变型机床和专用机床。
模块化设计的一般过程:模块化设计分为两个不同层次,第一个层次为系列模块化产品研制过程,需要根据市场调研结果对整个系列进行模块化设计,本质上是系列产品研制过程,如图2.1所示。
图2.1 模块化系列产品研制过程第二个层次为单个产品的模块化设计,需要根据用户的具体要求对模块进行选择和组合,并加以必要的设计计算和校核计算,本质上是选择及组合过程,如图2.2所示。
图2.2 模块化产品设计过程总的说来,模块化设计遵循一般技术系统的设计步骤,但比后者更复杂,花费更高,要每个零部件都能实现更多的部分功能。
1.市场调查与分析模块化设计成功的前提。
必须注意市场对同类产品的需求量、市场对同类产品基型和各种变型的需求比例,分析来自用户的要求,分析模块化设计的可行性等。
对市场需求量很少而又需要付出很大的设计与制造花费的产品,不应在模块化系统设计的总功能之中。
2.进行产品功能分析,拟定产品系列型谱合理确定模块化设计所覆盖的产品种类和规格,种类和规格过多,虽对市场应变能力强,有利于占领市场,但设计难度大,工作量大;反之,则对市场应变能力减弱,但设计容易,易于提高产品性能和针对性。
3.确定参数X围和主参数产品参数有尺寸参数、运动参数和动力参数(功率、转矩、电压等),须合理确定,过高过宽造成浪费,过低过窄不能满足要求。
另外,参数数值大小和数值在参数X围内的分布也很重要,最大、最小值应依使用要求而定。
主参数是表示产品主要性能、规格大小的参数,参数数值的分布一般用等比或等差数列。
确定模块化设计类型,划分模块只有少数方案用到的特殊功能,可由非模块实现:若干部分功能相结合,可由一个模块实现(对于调整功能尤其如此)。
4.模块结构设计,形成模块库由于模块要具有多种可能的组合方式,因此设计时要考虑到一个模块的较多接合部位,应做到加工合理、装配合理;应尽量采用标准化的结构;尽量用多工位组合机床同时加工,否则模块的加工成本将非常可观;还应保证模块寿命相当,维修及更换方便。
5.编写技术文件由于模块化设计建立的模块常不直接与产品联系,因此必须注意其技术文件的编制,才能将不同功能的块有机联系起来,指导制造、检查和使用。
技术文件主要包括以下内容:(1)编制模块组合与配置各产品的关系表。
其中应包括全系列的模块种类及各产品使用的模块种类和数量。
(2)编制所有产品的模块组和模块目录表,标明各产品和模块组的组成。
(3)编制系列通用的制造与验收条件、合格证明书及装箱单。
(4)编制模块式的使用说明以适应不同产品、不同模块的需要。
模块的划分根据其划分角度的不同,有不同的划分方式,最终得到不同的基本单元。
从产品生命周期的观点看,这些不同的划分角度分别是面向产品生命周期中的不同阶段。
因此,可以根据模块划分所面向的生命周期中的具体阶段,把模块划分为:(1)面向设计的模块划分(2)面向制造的模块划分(3)面向使用、装配和维修的模块划分(4)面向回收的模块划分(5)面向整个生命周期的模块划分本次数控机床的设计从面向设计的角度来进行数控机床模块的划分。
首先对数控机床的功能进行分解,将数控机床的总的功能分解为不同的功能元,根据不同功能元之间的相关性定性的进行模块聚类,其次按照结构将已经聚类的功能模块对应的零部件分解出来,再根据各个零部件之间在制造和装配上的相关性进行分析,最终将两次分析的结果综合起来得到更为细小的具有不同用途或性能的模块。
将数控机床分为10个模块,具体划分如下:传动模块:丝杠,联轴器,伺服电机,电机架,轴承端盖,轴承架支撑连接模块:导轨,滑块工作台模块:工作台底盘,工作台托盘主轴箱模块:主轴箱体,主轴刀库模块:刀库,抓刀机械手防护模块:丝杠防护罩,整机防护罩辅助模块:气动液压装置,排屑装置,冷却装置,润滑装置,电气控制装置床身模块:床身立柱模块:立柱滑板模块:滑板二、查阅相关资料,围绕相似设计或模块化设计写一篇小论文?数控机床作为最为重要的制造装备之一,是机电行业的重要基础;是交通、电子及采矿产业实现生产现代化的最主要的手段;是制造业实现自动化、柔性化、集成化的基础;同时也是发展军事工业的重要战略物资。
目前,国内模具、汽车等行业的兴旺,使得市场对数控机床的需求量增大,这给数控机床的发展带来了新一轮的发展机遇,但同时也带来了挑战,这种挑战主要来自于用户对数控机床性能个性化、多样化的需求与产品生产性能、产品生产成本之间矛盾的切入点的寻优。
此外、国外知名机床制造厂家纷纷在国内设立设计、生产基地使得国内数控机床原有的价格优势已经不再明显。
面对市场和国外竞争厂商带来的挑战和压力是摆在国内制造业企业、各大院校和科研机构面前刻不容缓需要得到解决的课题。
为了这些问题、许多企业采用了模块化设计这一指导思想。
所谓模块化设计就是指将机床分解成相对独立的子单元并通过对这些子单元的标准化和重新配置最终产生一组满足不同客户需求的产品集合。
这些相对独立的子单元具有特定的功能和完整的接口,所以我们可以称之为模块。
模块是模块化产品的基本组成元素。
通过模块组合来实现全局功能的产品即可称为模块化产品。
与传统意义上的数控机床相比,模块化设计是一种柔性开发策略。
企业能够通过模块的重组来实现数控机床的开发从而缩短了开发的周期和设计成本。
数控机床中有不少独立的功能单元如导轨件、丝杠副、冷却、润滑、驱动、控制、检测装置等。
这一特点使其适应于模块化设计方法。
近几年来、随着计算机技术的迅速发展,大多数企业实现了信息化和数字化。
而CAD技术在企业数字化信息化过程中起着重要作用。
正如此、基于计算机辅助设计的模块化设计已经成为当前研究热点之一。
然而目前绝大多数CAD系统软件比如UG、CATIA、Pro/E、Solid Works等。
虽然提供了一些常用的标准件库但是都没有提供面向产品设计的参数化、用户可方便自扩充的模块数据库。
这样对于产品设计人员就常常因为没有模块数据库而要进行很多不必要的重复绘图工作大大降低了设计人员的工作效率。
因此要在CAD系统上建立一套用户自己可以维护修改的参数化的模块设计库便成了企业进行模块化设计要解决的当务之急。
对于模块化的概念Urich认为模块化与设计中的两个特点紧密相关。
1.设计中功能领域与物理结构领域之间的对应程度影响模块化的程度2.产品物理结构间相互影响程度的最小化。
这两点从设计学角度指出了影响模块化设计的基本因素。
Sun从功能—设计参数映射的角度定义模块化设计。
模块化设计是一种分析结果的产生,是这种结果以产品、过程和系统的形式表现并满足预定的需求,其方法是选择适当的设计参数完成从功能需求域到设计参数域的映射。
Paul和Berlitz认为模块化设计是完成从功能需求域到模块功能域的映射,然后再考虑模块性能(如尺寸、重量等)基础上完成从模块功能域到模块结构域的映射并将模块功能域的功能分为基本功能、附加功能、适应性功能、专用功能和用户定制功能五类相应的将模块结构定义为基本模块、附加模块、适应性模块、专用模块和用户定制模块。
在国内、贾延林认为模块化设计实在对一定X围内的不同功能或相同功能不同性能、不同规格的产品进行功能分析的基础上划分并设计出一系列功能模块,通过模块的选择和重组可以构成不同的产品,以满足市场不同需求的设计方法。
劳俊等人认为、模块化设计是综合考虑系统对象,把系统按功能分解成不同用途和性能的模块并使之接口标准化选择不同的模块(必要时设计部分专用模块)迅速组成各种要求的系统的一种方法。
童时中从系统论角度定义模块化为:为取得最佳效益,从系统观点出发研究产品(从系统)的构成形式用分解和组合的方法建立模块化系统并运用模块组合成产品(或系统)的全过程。
施进发、梁锡昌认为机床模块化设计是讲机床上同一功能的单元设计成具有不同用途或者性能的课互相选用的模块根据市场需要拼组成具有不同性能特点的机床。
胡维刚认为模块是一组同时具有相同功能和相同结合要素而具有不同性能或用途甚至不同结构特征但能互换的单元。
并进一步指出模块化设计是基于模块的思想将一般产品设计任务设计成模块化产品方案的设计成模块化产品方案的设计方法。
在设计方法上、国外的Zakuski的文章中表达了一种侧重于功能分解和集成的模块化设计方法,主要指产品和过程的集成对产品的分解、集成和评估做了讨论。
Sakieh和Kamrar发展了一种结构化的方法。
这种方法包括需求分析、概念分析(分解)、概念集成。
他们提出了方法中各步骤的结合度。
Jiao和Ts-eng发展了一种模块性的系统规划。
在三个连续的观点中—功能(需求分析)、技术(分解—集成)、物理(经济评估),集成了产品开发中的不同阶段。
国内XX大学的祁国宁教授也提出了一种基于结构特征的设计方法。
在模块的识别研究上,国外GU等人提出的面向产品全生命周期的模块化划分方法,针对每一阶段的设计目标构造相关矩阵,由设计师对每一个设计目标的模块划分结果进行对比和综合,得到最终的模块划分结果;Stone等提出一种启发式模块创建方法,根据产品功能结构图中的能量流、物料流、信号流一级力等来进行产品模块划分。