【计算机类职业资格】计算机二级(C++)上机考试30及答案解析.doc

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

1、计算机二级(C+)上机考试 30及答案解析(总分:-3.00,做题时间:90 分钟)1.改错题 使用 VC6打开考生文件夹下的工程 test7_1,此工程包含一个源程序文件 test7_1.cpp,但该程序运行有问题,请改正程序中的错误,使程序的输出结果如下: Constructor1 Constructor1 Constructor1 Destructor Constructor2 Destructor x=0 x=5 Destructor Destructor 源程序文件test1_1.cpp清单如下: #include class B int x; public: B()x=0;cout

2、y) t=x; x=y; y=t; coutz) t=x; x=z; z=t; if(yz) t=y; y=z; z=t; coutx/ty/tz解析:本题考查考生对函数重载与引用调用的掌握。这里的重载是使用不同的参数个数,引用调用的形参使用 public: void print(int x,int y,int z); ; void Table:print (int x,int y,int z) /*2* class Table9:public Table public: void print(); ; void Table9:print() /*3* int x,y,z; for (i=1;i_正确答案:((1) int x; int y; (2) printf( “%d*%d=%d “,x,y,z); if(z解析:主要考查考生将具体问题抽象为类,将类的定义补充完整,并进行类定义测试的能力。注意(2)中格式化输出函数 printf的使用格式,%d 代表输出的为整型。

展开阅读全文
相关资源
猜你喜欢
  • STAS SR ISO 2285-1995 Vulcanized or thermoplastic rubber — Determination of tension set at normal and high temperatures《硫化货热塑性橡胶.设定在常温和高温下的张力测试 》.pdf STAS SR ISO 2285-1995 Vulcanized or thermoplastic rubber — Determination of tension set at normal and high temperatures《硫化货热塑性橡胶.设定在常温和高温下的张力测试 》.pdf
  • STAS SR ISO 2303+A1-1996 Ssoprene rebber (IR)  Non-oil extended  solution-poiymenzed types - Evaluation procedure《异戊橡胶的非石油延伸,聚合溶解类型.评价程序 》.pdf STAS SR ISO 2303+A1-1996 Ssoprene rebber (IR) Non-oil extended solution-poiymenzed types - Evaluation procedure《异戊橡胶的非石油延伸,聚合溶解类型.评价程序 》.pdf
  • STAS SR ISO 2315-1995 Aircraft - Two and four pole sealed electromagnetic relay 2 A and 3 A - Clearance and fixing dimensions《飞行器.2和4极密封电磁继电器,2A和3A.清除和修复部分 》.pdf STAS SR ISO 2315-1995 Aircraft - Two and four pole sealed electromagnetic relay 2 A and 3 A - Clearance and fixing dimensions《飞行器.2和4极密封电磁继电器,2A和3A.清除和修复部分 》.pdf
  • STAS SR ISO 2354-1995 Magnesium alloys Determination of insoluble zirconium Alizarin sulphonate photometric method《镁合金.不溶性锆的测定.茜素磺酸光度法》.pdf STAS SR ISO 2354-1995 Magnesium alloys Determination of insoluble zirconium Alizarin sulphonate photometric method《镁合金.不溶性锆的测定.茜素磺酸光度法》.pdf
  • STAS SR ISO 2374-1983 Lifting aDpiiances - Range of maximum capacities for basic models《起重装置.基本模式的最大能力范围 》.pdf STAS SR ISO 2374-1983 Lifting aDpiiances - Range of maximum capacities for basic models《起重装置.基本模式的最大能力范围 》.pdf
  • STAS SR ISO 2380-2-1994 SCREWDRIVERS FOR SLOTTED-HEAD SCREWS Part 2  General requirements lengts of blades and marking of hand operated screwdrivers《狭槽头螺钉的螺丝刀.第二部:一般要求,刀片的长度和手工操作螺丝.pdf STAS SR ISO 2380-2-1994 SCREWDRIVERS FOR SLOTTED-HEAD SCREWS Part 2 General requirements lengts of blades and marking of hand operated screwdrivers《狭槽头螺钉的螺丝刀.第二部:一般要求,刀片的长度和手工操作螺丝.pdf
  • STAS SR ISO 2382-5-1995 Information processing systems - Vocabulary -Part 05  Representation of data《信息处理系统.词汇.第5部分:数据表示》.pdf STAS SR ISO 2382-5-1995 Information processing systems - Vocabulary -Part 05 Representation of data《信息处理系统.词汇.第5部分:数据表示》.pdf
  • STAS SR ISO 2398-1995 Industrial rubber hose for compressed air (up to 2 5 MPa)《压缩空气的工业用橡胶软管(高达2.5兆帕) 》.pdf STAS SR ISO 2398-1995 Industrial rubber hose for compressed air (up to 2 5 MPa)《压缩空气的工业用橡胶软管(高达2.5兆帕) 》.pdf
  • STAS SR ISO 2406-1995 Continuous mechanical handling equipment - Mobile and portable conveyors - Constructional specifications《连续机械装卸设备.可移动和便携式.施工规范 》.pdf STAS SR ISO 2406-1995 Continuous mechanical handling equipment - Mobile and portable conveyors - Constructional specifications《连续机械装卸设备.可移动和便携式.施工规范 》.pdf
  • 相关搜索

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

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