ImageVerifierCode 换一换
格式:DOCX , 页数:14 ,大小:16.43KB ,
资源ID:9807402      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/9807402.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(chapter26e.docx)为本站会员(b****8)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

chapter26e.docx

1、chapter26eTRUE/FALSE1.In the following code fragment, x has the value of 3.int x = 3; ANSWER: TRUE2.The body of a do-while loop always executes at least once. ANSWER: TRUE3.The body of a while loop may never execute. ANSWER: TRUE4.The opposite of (x 3 & x 10) is (x 10) ANSWER: FALSE5.The integer 0 i

2、s considered true. ANSWER: FALSE6.Loops are used when we need our program to make a choice between two or more things. ANSWER: FALSE7.It is legal to declare more than one variable in a single statement. ANSWER: TRUE8.Variable names may begin with a number. ANSWER: FALSE9.The opposite of less than is

3、 greater than ANSWER: FALSE10.Every line in a program should have a comment. ANSWER: FALSEShort Answer1. is called the _ operator.ANSWER: insertion2.The braces for a loop define the _ of the loop.ANSWER: body3.A loop that always executes the loop body at least once is known as a _ loop.ANSWER: do-wh

4、ile4.int myValue; is called a _.ANSWER: variable declaration5.What is the opposite of ( x 12)? _ANSWER: (x =20 | x 19 & x is known as the _ operator.ANSWER: extraction10.Is used for input or output? _ANSWER: output11.The stream that is used for input from the keyboard is called _.ANSWER: cin12.The s

5、tream that is used for output to the screen is called _.ANSWER: cout13.Write the loop condition to continue a while loop as long as x is negative. _ANSWER: while(x 0)14.When must we use braces to define the body of a contitional expression? _ANSWER: When there are multiple statements in the body.15.

6、In a compound logical and (&) expression, the evaluation of the expression stops once one of the terms of the expression is false. This is known as _ evaluation.ANSWER: short-circuit evaluationMultiple Choice1.Which of the following is a valid identifier?a.3comb.three_comc.3_comd.3-come.dollar$ANSWE

7、R: C (should be B)2.Which of the following is not a valid identifer?a.returnb.myIntc.myIntegerd.total3ANSWER: A3.What is the value of x after the following statements?int x, y, z;y = 10;z = 3;x = y * z + 3;a.Garbageb.60c.30d.33ANSWER: D4.What is the value of x after the following statements?int x;x

8、= 0;x = x + 30;a.0b.30c.33d.garbageANSWER: B5.What is the value of x after the following statements?int x;x = x + 30;a.0b.30c.33d.garbageANSWER: D6.What is the output of the following code?float value;value = 33.5;cout value endl;a.33.5b.33c.valued.garbageANSWER: A7.What is the output of the followi

9、ng code?float value;value = 33.5;cout value endl;a.33.5b.33c.valued.garbageANSWER: C8.What is the output of the following code?cout This is a myFloat;b.cin myFloat;d.cin myFloat endl;ANSWER: A10.Another way to write the value 3452211903 isa.3.452211903e09b.3.452211903e-09c.3.452211903x09d.3452211903

10、e09ANSWER: A11.Which of the following statements is NOT legal?a.char ch=b;b.char ch=0;c.char ch=65;d.char ch=cc;ANSWER: D12.What is the value of x after the following statements?float x;x = 15/4;a.3.75b.4.0c.3.0d.60ANSWER: C13.What is the value of x after the following statements?int x;x = 15/4;a.15

11、b.3c.4d.3.75ANSWER: B14.What is the value of x after the following statements?int x;x = 15 %4;a.15b.4c.3d.3.75ANSWER: C15.What is the value of x after the following statement?float x;x = 3.0 / 4.0 + 3 + 2 / 5 a.5.75 b.5.75c.1.75d.3.75ANSWER: D16.What is the value of x after the following statement?f

12、loat x;x = 3.0 / 4.0 + (3 + 2 )/ 5 a.5.75 b.5.75c.1.75d.3.75ANSWER: C17.What is the value of x after the following statements?double x;x = 0;x += 3.0 * 4.0;x -= 2.0;a.22.0b.12.0c.10.0d.14.0ANSWER: C18.Given the following code fragment and the input value of 4.0, what output is generated?float tax;fl

13、oat total;cout total;if ( total = 3.0) tax = 0.10; cout total + (total * tax) endl;else cout total endl;a.3b.3.3c.4.0d.4.4ANSWER: D19.Given the following code fragment and the input value of 2.0, what output is generated?float tax;float total;cout total;if ( total = 3.0) tax = 0.10; cout total + (to

14、tal * tax) endl;else cout total endl;a.2.2b.2.0c.3.1d.4.4ANSWER: B20.If x has the value of 3, y has the value of -2, and w is 10, is the following condition true or false?if( x 2 & w y)a.trueb.falseANSWER: B21.What is the correct way to write the condition y x z?a.(y x z)b.( (y x) | (y z)d.(y x) & (

15、x z)ANSWER: D22.Given the following code fragment, and an input value of 3, what is the output that is generated?int x;cout x;if(x=0) cout x is zeron;else cout x is not zeron;a.x is zerob.x is not zeroc.unable to determined.x is 3ANSWER: A (note it is an assignment!)23.Given the following code fragm

16、ent, and an input value of 5, what is the output?int x;if( x 3) cout smalln;else if( x 4) cout mediumn; else if( x 6) cout largen; else cout 5) cout x is bigger than 5. ; cout That is all. ;cout Goodbyen;a.x is bigger than 5. That is allb.x is bigger than 5c.That is all. Goodbyed.GoodbyeANSWER: C25.

17、Executing one or more statements one or more times is known as:a.selectionb.iterationc.sequenced.algorithmANSWER: B26.Given the following code fragment, what is the final value of y?int x, y;x = -1;y = 0;while(x = 3) y += 2; x += 1;a.2b.10c.6d.8ANSWER: B27.Given the following code fragment, what is

18、the final value of y?int x, y;x = -1;y = 0;while(x 3) y += 2; x += 1;a.2b.10c.6d.8ANSWER: D28.What is the output of the following code fragment?int x=0;while( x 5) cout x endl; x +;cout x 0);a.8b.9c.10d.11e.infinite loop.ANSWER: E30.Given the following code fragment, which of the following expressions is always true?int x;cin x;a.if( x 1 )d.if( x = 1)ANSWER: D

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1