[计算机类试卷]国家二级C++机试(操作题)模拟试卷339及答案与解析.doc

上传人:confusegate185 文档编号:497420 上传时间:2018-11-28 格式:DOC 页数:9 大小:39.50KB
下载 相关 举报
[计算机类试卷]国家二级C++机试(操作题)模拟试卷339及答案与解析.doc_第1页
第1页 / 共9页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷339及答案与解析.doc_第2页
第2页 / 共9页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷339及答案与解析.doc_第3页
第3页 / 共9页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷339及答案与解析.doc_第4页
第4页 / 共9页
[计算机类试卷]国家二级C++机试(操作题)模拟试卷339及答案与解析.doc_第5页
第5页 / 共9页
点击查看更多>>
资源描述

1、国家二级 C+机试(操作题)模拟试卷 339及答案与解析 一、基本操作题 1 请使用 VC6或使用【答题】菜单打开考生文件夹 projl下的工程 pmjl,此工程包含 个源程序文件 projl cpp。其中位于每个注释 “ ERROR*found*”之后的一行语句存在错误。请改正这些错误,使程序的输出结果为: You are right 注意:只修改注释 “ ERROR *found*”的下一行语句,不要改动程序中的其他内容。 projl cpp #include using namespace std; class MyClass public: MyClass(int X): number

2、x)l ERROR *found* 一 MyClass(int X) ERROR *found* void Judge(MyClass return 0; 三、综合应用题 4 使用 VC6打开考生文件夹 proj3下的工程 proj3,其中定义了一个字符串变量类StringVar。类成员的说明在程序注释中。请在 *333*和 *666*之间填写 StringVar成员函数和友元函数的实现代码。在 main函数中给出了一组测试数据,运行时输入: Hello Kitty 此情况下程序的输出应该是: Hello Kitty Borg Borg 注意:只需在 *333*和 *666*之间填入所编写的

3、若干语句,不要改动程序中的其他内容。 StringVar h #include #include #include #include USing namespace std; void writeToFile (const char * path); class StringVar public: StringVar(int size);构造函数, size为字符串长度 (字符个数 )初始值;字符串内容初始化为空串 StringVar(const char a);构造函数,用参数数组 a的内容初始化当前对象 StringVar (const StringVar析构函数 int length()

4、constreturn Strlen (value); ) 从输入流 ins输入一个字符串,其中可以包括空格 void input_line(istream value0= 0; StringVar: StringVar(const char a ) max_length=strlen(a)+1; value=new charmax_length; strcpy(value, a), StringVar: StringVar (const StringVar strcpy(value, strobj value); void StringVar: input_line(istream& ins) int i=0; char ch; while(imax, 1ength一 1 (ch =ins get()!=n) valuei+=ch; valuei= 0; ostream&operator(ostream&outs, const StringVar the_string) outsthe_string getValue() end1; return outs;

展开阅读全文
相关资源
猜你喜欢
  • ASME QME-1-2007 Qualification of ACTV Mechanical Equipment Used in Nuclear Power Plants (QME-1 - 2007)《核电站用放射性机械设备的合格证书》.pdf ASME QME-1-2007 Qualification of ACTV Mechanical Equipment Used in Nuclear Power Plants (QME-1 - 2007)《核电站用放射性机械设备的合格证书》.pdf
  • ASME QME-1-2012 Qualification of ACTV Mechanical Equipment Used in Nuclear Facilities (QME-1 - 2012)《核电站用放射性机械设备的合格证明》.pdf ASME QME-1-2012 Qualification of ACTV Mechanical Equipment Used in Nuclear Facilities (QME-1 - 2012)《核电站用放射性机械设备的合格证明》.pdf
  • ASME QME-1-2017 Qualification of Active Mechanical Equipment Used in Nuclear Facilities.pdf ASME QME-1-2017 Qualification of Active Mechanical Equipment Used in Nuclear Facilities.pdf
  • ASME QRO-1-2005 Standard for the Qualification and Certification of Resource Recovery Facility Operators《资源再利用设备使用者的资格和认证标准》.pdf ASME QRO-1-2005 Standard for the Qualification and Certification of Resource Recovery Facility Operators《资源再利用设备使用者的资格和认证标准》.pdf
  • ASME RA-S INTERPRETATIONS-2013 Interpretations to RA-S Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includ.pdf ASME RA-S INTERPRETATIONS-2013 Interpretations to RA-S Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includ.pdf
  • ASME RA-S INTERPRETATIONS-2013 Interpretations to RA-S Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includ_1.pdf ASME RA-S INTERPRETATIONS-2013 Interpretations to RA-S Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includ_1.pdf
  • ASME RA-S-1 3-2017 Standard for Radiological Accident Offsite Consequence Analysis (Level 3 PRA) to Support Nuclear Installation Applications.pdf ASME RA-S-1 3-2017 Standard for Radiological Accident Offsite Consequence Analysis (Level 3 PRA) to Support Nuclear Installation Applications.pdf
  • ASME RA-S-2008 Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includes Interpretations Volume 1)《核电站设施用1级 大型.pdf ASME RA-S-2008 Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includes Interpretations Volume 1)《核电站设施用1级 大型.pdf
  • ASME RA-S-2008 Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includes Interpretations Volume 1)《核电站设施用1级 大型_1.pdf ASME RA-S-2008 Standard for Level 1 Large Early Release Frequency Probabilistic Risk Assessment for Nuclear Power Plant Applications (Includes Interpretations Volume 1)《核电站设施用1级 大型_1.pdf
  • 相关搜索

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

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