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

展开阅读全文
相关资源
猜你喜欢
  • BS EN 28839-1992 Mechanical properties of fasteners - Bolts screws studs and nuts made of non-ferrous metals《紧固件机械性能 有色金属制螺栓、螺钉、螺柱和螺母》.pdf BS EN 28839-1992 Mechanical properties of fasteners - Bolts screws studs and nuts made of non-ferrous metals《紧固件机械性能 有色金属制螺栓、螺钉、螺柱和螺母》.pdf
  • BS EN 28877-1994 Information technology - Telecommunications and information exchange between systems - Interface connector and contact assignments for ISDN Basic Access Interface .pdf BS EN 28877-1994 Information technology - Telecommunications and information exchange between systems - Interface connector and contact assignments for ISDN Basic Access Interface .pdf
  • BS EN 29008-1994 Glass bottles - Verticality - Test method《玻璃瓶 垂直度 试验方法》.pdf BS EN 29008-1994 Glass bottles - Verticality - Test method《玻璃瓶 垂直度 试验方法》.pdf
  • BS EN 29009-1994 Glass containers - Height and non-parallelism of finish with reference to container base - Test methods《玻璃容器 以容器底为基准的瓶口高度和不平行性 试验方法》.pdf BS EN 29009-1994 Glass containers - Height and non-parallelism of finish with reference to container base - Test methods《玻璃容器 以容器底为基准的瓶口高度和不平行性 试验方法》.pdf
  • BS EN 29048-1991 Building construction - Jointing products - Determination of extrudability of sealants using standardized apparatus《房屋建筑 连接件 使用标准化仪器测定密封剂挤压性》.pdf BS EN 29048-1991 Building construction - Jointing products - Determination of extrudability of sealants using standardized apparatus《房屋建筑 连接件 使用标准化仪器测定密封剂挤压性》.pdf
  • BS EN 29052-1-1992 Acoustics - Method for the determination of dynamic stiffness - Materials used under floating floors in dwellings《声学 动态稳定度的测定方法 在住宅中浮隔地板下用的材料》.pdf BS EN 29052-1-1992 Acoustics - Method for the determination of dynamic stiffness - Materials used under floating floors in dwellings《声学 动态稳定度的测定方法 在住宅中浮隔地板下用的材料》.pdf
  • BS EN 29053-1993 Acoustics - Materials for acoustical applications - Determination of airflow resistance《声学 声学用材料 气流阻尼的测定》.pdf BS EN 29053-1993 Acoustics - Materials for acoustical applications - Determination of airflow resistance《声学 声学用材料 气流阻尼的测定》.pdf
  • BS EN 29073-3-1990 Methods of test for nonwovens - Methods of test for nonwovens - Determination of tensile strength and elongation《纺织品 无纺织物试验方法 抗张强度和伸张度测定》.pdf BS EN 29073-3-1990 Methods of test for nonwovens - Methods of test for nonwovens - Determination of tensile strength and elongation《纺织品 无纺织物试验方法 抗张强度和伸张度测定》.pdf
  • BS EN 29090-1992 Specification for gas tightness of equipment for gas welding and allied processes《气焊及相关工艺用设备气密性规范》.pdf BS EN 29090-1992 Specification for gas tightness of equipment for gas welding and allied processes《气焊及相关工艺用设备气密性规范》.pdf
  • 相关搜索

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

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