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

展开阅读全文
相关资源
猜你喜欢
  • JUS M B6 212-1977 Lappedjoint short stub ends for nomiml pressure 10《搭接短连接头 公称压力10》.pdf JUS M B6 212-1977 Lappedjoint short stub ends for nomiml pressure 10《搭接短连接头 公称压力10》.pdf
  • JUS M B6 213-1977 Plain welding flanges for tank trucks for nominal pressure 61《油桶支架的普通焊接法兰,标准压力 61》.pdf JUS M B6 213-1977 Plain welding flanges for tank trucks for nominal pressure 61《油桶支架的普通焊接法兰,标准压力 61》.pdf
  • JUS M B6 290-2003 Industrial valves - Bolts and nuts for piping work《管道工程的工业阀门螺栓及螺帽》.pdf JUS M B6 290-2003 Industrial valves - Bolts and nuts for piping work《管道工程的工业阀门螺栓及螺帽》.pdf
  • JUS M B6 690-1984 Tube fittings and unions with identing ferule Technical requirements《带刻痕环的管道配件及管道组合 技术要求》.pdf JUS M B6 690-1984 Tube fittings and unions with identing ferule Technical requirements《带刻痕环的管道配件及管道组合 技术要求》.pdf
  • JUS M B6 699-1984 Tube fittings and unions with indenting ferule Tube adaptor with cilindrical plain end Assembly and tnain dimensions《带刻痕环的管道配件及管道组合 带圆柱平管口的管道适配器 装配及主要尺寸》.pdf JUS M B6 699-1984 Tube fittings and unions with indenting ferule Tube adaptor with cilindrical plain end Assembly and tnain dimensions《带刻痕环的管道配件及管道组合 带圆柱平管口的管道适配器 装配及主要尺寸》.pdf
  • JUS M B6 701-1989 Tube fittings and unions with indenting ferule Instructions for assembling《配有压凹铁套管的管配件与部件 安装指南》.pdf JUS M B6 701-1989 Tube fittings and unions with indenting ferule Instructions for assembling《配有压凹铁套管的管配件与部件 安装指南》.pdf
  • JUS M B6 702-1985 Tube fittings and unions with indentina ferrule Tube adaptor Assemblv and maln dimensions《带刻痕环的管道配件及管道组合 管道适配器 装配及主要尺寸》.pdf JUS M B6 702-1985 Tube fittings and unions with indentina ferrule Tube adaptor Assemblv and maln dimensions《带刻痕环的管道配件及管道组合 管道适配器 装配及主要尺寸》.pdf
  • JUS M B6 703-1985 Tube fittings and unions with indenting fermle Complete union Assembly and main dimensions《带刻痕环的管道配件及管道组合 组合总成 装配及尺寸》.pdf JUS M B6 703-1985 Tube fittings and unions with indenting fermle Complete union Assembly and main dimensions《带刻痕环的管道配件及管道组合 组合总成 装配及尺寸》.pdf
  • JUS M B6 704-1985 Tube fittings and unions with indenting ferrule Bulkhead lead-in union Assembly and main dimensions《带刻痕环的管道配件及管道组合 隔水壁引入组合 装配及主要尺寸》.pdf JUS M B6 704-1985 Tube fittings and unions with indenting ferrule Bulkhead lead-in union Assembly and main dimensions《带刻痕环的管道配件及管道组合 隔水壁引入组合 装配及主要尺寸》.pdf
  • 相关搜索

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

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