资源描述:
《面向对象程序设计技术-自测1答案.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、C++语言程序设计自测练习(一)参考解答一、单项选择题1.A2.C3.B4.B5.B6.C7.A8.D9.B10.D11.D12.C13.D14.D15.C16.A17.B18.A19.C20.B21.B22.C23.C24.B25.D26.C27.A28.A29.C30.B31.D32.C33.D34.C35.C36.A37.B38.B39.C40.A41.C42.C43.A44.B45.B46.A47.B48.B49.C50.B二、填空题1.C2..cpp程序3.//4./**/5.cout6.cin7.main8.复合9.空白10.#include11.#12.分号13
2、.用户(或编程者)14.程序15.函数头函数体16.原型(或声明)17..h.cpp18.警告(warning)致命(error)19.void20.void21.int022.下一行23.3524.2525.63026.41127.32528.22929.0xF5(F大小写均可)30.036531.-128+12732.4433.4834.1135.2436.1537.1538.739.640.1341.33.242.x43.true(或1)44.false(或0)45.x46.!x47.false(或0)48.true(或1)49.(x+y)/(2*x*y)50.3*x*
3、y/(x+y)51.1/(a*x*x+b*y*y)52.153.354.4255.枚举常量整数56.intdouble57.66058.4159.2060.9216三、程序填充题,对程序、函数或类中划有横线的位置,根据题意按标号把合适的内容填写到程序下面相应标号的后面1.(1)f1+f2(2)i%5==0(3)f2.(1)x(2)I(3)-j3.(1)n<=99(2)i<=temp(3)break4.(1)b<=0(2)a=b(3)b=r5.(1)x<3(或x<=2)(2)x%i==0(3)i++6.(1)b%i==0(2)i++(或++i)(3)b>=i7.(1)i<=5(
4、2)j>=5+i(3)cout<<’*’8.(1)str[i]>=’A’&&str[i]<=’Z’(2)num++(3)returnnum9.(1)voidfun(charss[])(2)fun(s)(3)i