【计算机类职业资格】国家二级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的乘法口诀。

展开阅读全文
相关资源
猜你喜欢
  • ASTM E2091-2017 Standard Guide for Use of Activity and Use Limitations Including Institutional and Engineering Controls《活动使用和使用限制标准指南 包括机构和工程控制》.pdf ASTM E2091-2017 Standard Guide for Use of Activity and Use Limitations Including Institutional and Engineering Controls《活动使用和使用限制标准指南 包括机构和工程控制》.pdf
  • ASTM E2092-2004 Standard Test Method for Distortion Temperature in Three-Point Bending by Thermomechanical Analysis《热机分析三点弯曲处变形温度的标准试验方法》.pdf ASTM E2092-2004 Standard Test Method for Distortion Temperature in Three-Point Bending by Thermomechanical Analysis《热机分析三点弯曲处变形温度的标准试验方法》.pdf
  • ASTM E2092-2013 Standard Test Method for Distortion Temperature in Three-Point Bending by Thermomechanical Analysis《采用热机械分析对三点弯曲上变形温度的的标准试验》.pdf ASTM E2092-2013 Standard Test Method for Distortion Temperature in Three-Point Bending by Thermomechanical Analysis《采用热机械分析对三点弯曲上变形温度的的标准试验》.pdf
  • ASTM E2092-2018 Standard Test Method for Distortion Temperature in Three-Point Bending by Thermomechanical Analysis.pdf ASTM E2092-2018 Standard Test Method for Distortion Temperature in Three-Point Bending by Thermomechanical Analysis.pdf
  • ASTM E2093-2005 Standard Guide for Optimizing Controlling and Reporting Test Method Uncertainties from Multiple Workstations in the Same Laboratory Organization《来自同一实验室机构中多个工作站的试验方.pdf ASTM E2093-2005 Standard Guide for Optimizing Controlling and Reporting Test Method Uncertainties from Multiple Workstations in the Same Laboratory Organization《来自同一实验室机构中多个工作站的试验方.pdf
  • ASTM E2093-2012 Standard Guide for Optimizing Controlling and Assessing Test Method Uncertainties from Multiple Workstations in the Same Laboratory Organization 《优化 控制和评估同一实验室组织中多工.pdf ASTM E2093-2012 Standard Guide for Optimizing Controlling and Assessing Test Method Uncertainties from Multiple Workstations in the Same Laboratory Organization 《优化 控制和评估同一实验室组织中多工.pdf
  • ASTM E2093-2012(2016) Standard Guide for Optimizing Controlling and Assessing Test Method Uncertainties from Multiple Workstations in the Same Laboratory Organization 《来自同一实验室机构中多个.pdf ASTM E2093-2012(2016) Standard Guide for Optimizing Controlling and Assessing Test Method Uncertainties from Multiple Workstations in the Same Laboratory Organization 《来自同一实验室机构中多个.pdf
  • ASTM E2096 E2096M-2010 Standard Practice for In Situ Examination of Ferromagnetic Heat-Exchanger Tubes Using Remote Field Testing《利用远场试验现场检测铁磁性热交换管的标准操作规程》.pdf ASTM E2096 E2096M-2010 Standard Practice for In Situ Examination of Ferromagnetic Heat-Exchanger Tubes Using Remote Field Testing《利用远场试验现场检测铁磁性热交换管的标准操作规程》.pdf
  • ASTM E2096 E2096M-2016 Standard Practice for In Situ Examination of Ferromagnetic Heat-Exchanger Tubes Using Remote Field Testing《利用远程现场试验现场检验铁磁换热器管的标准实施规程》.pdf ASTM E2096 E2096M-2016 Standard Practice for In Situ Examination of Ferromagnetic Heat-Exchanger Tubes Using Remote Field Testing《利用远程现场试验现场检验铁磁换热器管的标准实施规程》.pdf
  • 相关搜索

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

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