【计算机类职业资格】国家二级C++机试(操作题)模拟试卷382及答案解析.doc

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

1、国家二级 C+机试(操作题)模拟试卷 382及答案解析(总分:6.00,做题时间:90 分钟)一、基本操作题(总题数:1,分数:2.00)1.使用 VC6打开考生文件夹下的源程序文件 modilcpp,但该程序运行时有错,请改正程序中的错误,使程序输出的结果为: i=5 i=10 i=15 i=20 注意:错误的语句在*error*的下面,修改该语句即可。 #include class CMyClass public: template void func(T x,T Y) *error* T i=0; if(x=i) i=i+x; else i=i+y; coutname; innumber

2、 inmark; mcount+; m pStui=new Student (name,number,mark); cout m_pStuindex-mmark) index=j; *2* if() Student*ps=m pStui; m_pStui=m_pStu index; mpStuindex=ps; void Teacher:Display() cout m pStuindex一m mark) count=1; index=j; pScount+=m pStu index; else if(m_pstujmmark =m_pStuindex一m_mark) index=j; pS

3、count+=m pStu index; return count; void main() Teacher Teacher; Student*pStudentNMAX; cout=i) i=i+x; else i=i+y; coutname; innumber; inmark; mcount+; m pStui=new Student (name,number,mark); cout m_pStuindex-mmark) index=j; *2* if() Student*ps=m pStui; m_pStui=m_pStu index; mpStuindex=ps; void Teache

4、r:Display() cout m pStuindex一m mark) count=1; index=j; pScount+=m pStu index; else if(m_pstujmmark =m_pStuindex一m_mark) index=j; pScount+=m pStu index; return count; void main() Teacher Teacher; Student*pStudentNMAX; cout“输入的学生信息:”endl“排序后的学生信息:”endl“查询成绩最高的学生信息:” 9isplayMsg(); (分数:2.00)_正确答案:(正确答案:(1)添加语句:friend ClasS Teacher; (2)将“if()”补充完整为: if(i ndex!:j) (3)添加语句:pS0=m pStu0;)解析:解析:类 Student含有三个成员变量:姓名、五个英文字符的学号和精确到小数点后一位的一科成绩,类 Teacher含有 Student对象数组的指针 Student*m_pStuNMAX、m_average 和 mcount三个成员变量,类 Teacher有多个成员函数,完成学生数据输入、排序、查找最好成绩和打印等功能。

展开阅读全文
相关资源
猜你喜欢
  • IEC 60939-1-2010 Passive filter units for electromagnetic interference suppression - Part 1 Generic specification《抑制电磁干扰用无源滤波装置.第1部分 通用规范》.pdf IEC 60939-1-2010 Passive filter units for electromagnetic interference suppression - Part 1 Generic specification《抑制电磁干扰用无源滤波装置.第1部分 通用规范》.pdf
  • IEC 60939-2 CORR 1-2005 Passive filter units for electromagnetic interference suppression - Part 2 Sectional specification Passive filter units for which safety tests are appropria.pdf IEC 60939-2 CORR 1-2005 Passive filter units for electromagnetic interference suppression - Part 2 Sectional specification Passive filter units for which safety tests are appropria.pdf
  • IEC 60939-2-1-2004 Complete filter units for radio interference suppression - Part 2-1 Blank detail specification - Passive filter units for electromagnetic interference suppressio.pdf IEC 60939-2-1-2004 Complete filter units for radio interference suppression - Part 2-1 Blank detail specification - Passive filter units for electromagnetic interference suppressio.pdf
  • IEC 60939-2-2-2004 Complete filter units for radio interference suppression - Part 2-2 Blank detail specification - Passive filter units for electromagnetic interference suppressio.pdf IEC 60939-2-2-2004 Complete filter units for radio interference suppression - Part 2-2 Blank detail specification - Passive filter units for electromagnetic interference suppressio.pdf
  • IEC 60939-3-2015 Passive filter units for electromagnetic interference suppression - Part 3 Passive filter units for which safety tests are appropriate《用于电磁干扰抑制的无源滤波器单元 第3部分 适合用于进行安全测试的无源滤波器单.pdf IEC 60939-3-2015 Passive filter units for electromagnetic interference suppression - Part 3 Passive filter units for which safety tests are appropriate《用于电磁干扰抑制的无源滤波器单元 第3部分 适合用于进行安全测试的无源滤波器单.pdf
  • IEC 60944-1988 Guide for the maintenance of silicone transformer liquids《变压器硅油的维护指南》.pdf IEC 60944-1988 Guide for the maintenance of silicone transformer liquids《变压器硅油的维护指南》.pdf
  • IEC 60945-2002 Maritime navigation and radiocommunication equipment and systems - General requirements - Methods of testing and required test results《海上导航和无线电通信设备及系统.一般要求.测试方法和要求的测试结果》.pdf IEC 60945-2002 Maritime navigation and radiocommunication equipment and systems - General requirements - Methods of testing and required test results《海上导航和无线电通信设备及系统.一般要求.测试方法和要求的测试结果》.pdf
  • IEC 60946-1988 Binary direct voltage signals for process measurement and control systems《过程测量和控制系统的二进制直流电压信号》.pdf IEC 60946-1988 Binary direct voltage signals for process measurement and control systems《过程测量和控制系统的二进制直流电压信号》.pdf
  • IEC 60947-1-2007 Low-voltage switchgear and controlgear - Part 1 General rules《低压开关装置和控制装置.第1部分 一般规则》.pdf IEC 60947-1-2007 Low-voltage switchgear and controlgear - Part 1 General rules《低压开关装置和控制装置.第1部分 一般规则》.pdf
  • 相关搜索

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

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