【计算机类职业资格】国家二级C++机试(操作题)模拟试卷384及答案解析.doc

上传人:towelfact221 文档编号:1331882 上传时间:2019-10-17 格式:DOC 页数:2 大小:30.50KB
下载 相关 举报
【计算机类职业资格】国家二级C++机试(操作题)模拟试卷384及答案解析.doc_第1页
第1页 / 共2页
【计算机类职业资格】国家二级C++机试(操作题)模拟试卷384及答案解析.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、国家二级 C+机试(操作题)模拟试卷 384及答案解析(总分:6.00,做题时间:90 分钟)一、基本操作题(总题数:1,分数:2.00)1.使用 VC6打开考生文件夹下的源程序文件 modilcpp,但该程序运行时有错,请改正程序中的错误,使程序输出的结果为: This is a greart! Hello Hello 注意:错误的语句在*error*的下面,修改该语句即可。 #include class CMyClass public: void displayl() ( coutn; for(int i=0;iaij; couta=a; this 一b=b; void set(int X

2、int Y) a=x; b=y; void display() *3* ; int main() CMyFormula formular(1,1); for(int i=1;in; for(int i=0;iaij; couta=a; this 一b=b; void set(int X,int Y) a=x; b=y; void display() *3* ; int main() CMyFormula formular(1,1); for(int i=1;i=9;i+) *4* for(int j=1; j+) formularset(j,i); formulardisplay(); cout_正确答案:(正确答案:(1)添加语句:int a,b; (2)添加语句:CMyFormula(int a=l,int,b=1) (3)添加语句:couta*b=i ; j+)解析:解析:程序当中定义了类 CMyFormula,含有 a和 b两个成员变量,一个构造函数,改变成员变量a和 b的值得 set(int x,int y)函数,打印 a和 b的乘积的 display()函数。在主函数中定义了一个CMyFormula对象,然后不断改变该对象的 a和 b的值,然后调用 display()显示,如此完成打印 99的乘法口诀。

展开阅读全文
相关资源
猜你喜欢
  • KS C IEC 61377-2003 Electric traction-Rolling stock-Combined testing of inverter-fed alternating current motors and their control《铁路用电气设备 电气牵引用反向供电交流电动机及其控制的联合检验》.pdf KS C IEC 61377-2003 Electric traction-Rolling stock-Combined testing of inverter-fed alternating current motors and their control《铁路用电气设备 电气牵引用反向供电交流电动机及其控制的联合检验》.pdf
  • KS C IEC 61378-2-2002 Convertor transformers-Part 2:Transformers for HVDC applications《转换变压器 第2部分 HVDC用变压器》.pdf KS C IEC 61378-2-2002 Convertor transformers-Part 2:Transformers for HVDC applications《转换变压器 第2部分 HVDC用变压器》.pdf
  • KS C IEC 61400-12-1-2008 Wind turbines-Part 12-1:Power performance measurements of electricity producing wind turbines《风轮 第12部分 风轮发电的动力性能测试》.pdf KS C IEC 61400-12-1-2008 Wind turbines-Part 12-1:Power performance measurements of electricity producing wind turbines《风轮 第12部分 风轮发电的动力性能测试》.pdf
  • KS C IEC 61400-13-2007 Wind turbine generator systems-Part 13:Measurement of mechanical loads《风轮发电机系统 第13部分 机械负载测量》.pdf KS C IEC 61400-13-2007 Wind turbine generator systems-Part 13:Measurement of mechanical loads《风轮发电机系统 第13部分 机械负载测量》.pdf
  • KS C IEC 61400-14-2007 Wind turbines-Part 14:Declaration of apparent sound power level and tonality values《风轮机 第14部分 表面声功率级和音调值声明》.pdf KS C IEC 61400-14-2007 Wind turbines-Part 14:Declaration of apparent sound power level and tonality values《风轮机 第14部分 表面声功率级和音调值声明》.pdf
  • KS C IEC 61431-2002 Guide for the use of monitor systems forlead-acid traction batteries《酸性铅蓄电池监控系统使用导则》.pdf KS C IEC 61431-2002 Guide for the use of monitor systems forlead-acid traction batteries《酸性铅蓄电池监控系统使用导则》.pdf
  • KS C IEC 61436-2006 Sealed nickel-metal hydride rechargeable single cells《含有碱或者其他非酸性电解液的二次电池组和蓄电池组 密封式镍金属氢化物可再充电单电池组》.pdf KS C IEC 61436-2006 Sealed nickel-metal hydride rechargeable single cells《含有碱或者其他非酸性电解液的二次电池组和蓄电池组 密封式镍金属氢化物可再充电单电池组》.pdf
  • KS C IEC 61442-2006 Electric cables-Test methods for accessories for power cables with rated voltages from 6 kV(Um=7 2 kV) up to 30 kV(Um=36 kV)《电缆 额定电压从6 kV(Um=7 2 kV)~30 kV(Um=36.pdf KS C IEC 61442-2006 Electric cables-Test methods for accessories for power cables with rated voltages from 6 kV(Um=7 2 kV) up to 30 kV(Um=36 kV)《电缆 额定电压从6 kV(Um=7 2 kV)~30 kV(Um=36.pdf
  • KS C IEC 61468-2006 Nuclear power plants-In-core instrumentation-Characteristics and test methods of self-powered neutron detectors《核电厂 堆芯测量仪表 自给能中子探测器的特性和试验方法》.pdf KS C IEC 61468-2006 Nuclear power plants-In-core instrumentation-Characteristics and test methods of self-powered neutron detectors《核电厂 堆芯测量仪表 自给能中子探测器的特性和试验方法》.pdf
  • 相关搜索

    当前位置:首页 > 考试资料 > 职业资格

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1