【计算机类职业资格】国家二级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有多个成员函数,完成学生数据输入、排序、查找最好成绩和打印等功能。

展开阅读全文
相关资源
猜你喜欢
  • ISO 2401-1972 Covered electrodes Determination of the efficiency metal recovery and deposition coefficient《涂敷焊条 效率、金属回收和熔敷系数的测定》.pdf ISO 2401-1972 Covered electrodes Determination of the efficiency metal recovery and deposition coefficient《涂敷焊条 效率、金属回收和熔敷系数的测定》.pdf
  • ISO 24011-2009 Resilient floor coverings - Specification for plain and decorative linoleum《弹性地板铺装 普通和装饰油毡规范》.pdf ISO 24011-2009 Resilient floor coverings - Specification for plain and decorative linoleum《弹性地板铺装 普通和装饰油毡规范》.pdf
  • ISO 2402-1972 Shell reamers with taper bore (taper bore 1 30 (included)) with slot drive and arbors for shell reamers《键传动的锥孔[锥度1 30(含1 30)]套式铰刀及其刀杆》.pdf ISO 2402-1972 Shell reamers with taper bore (taper bore 1 30 (included)) with slot drive and arbors for shell reamers《键传动的锥孔[锥度1 30(含1 30)]套式铰刀及其刀杆》.pdf
  • ISO 2404-1986 Cinematography Six-track magnetic sound records on 70 mm striped release prints Locations and dimensions《电影 70mm电影发行拷贝上六轨磁性声迹 位置和尺寸》.pdf ISO 2404-1986 Cinematography Six-track magnetic sound records on 70 mm striped release prints Locations and dimensions《电影 70mm电影发行拷贝上六轨磁性声迹 位置和尺寸》.pdf
  • ISO 2406-1974 Continuous mechanical handling equipment Mobile and portable conveyors Constructional specifications《连续搬运设备 移动式和携带式输送机 结构规范》.pdf ISO 2406-1974 Continuous mechanical handling equipment Mobile and portable conveyors Constructional specifications《连续搬运设备 移动式和携带式输送机 结构规范》.pdf
  • ISO 2407 AMD 1-2016 Test conditions for internal cylindrical grinding machines with horizontal spindle - Testing of accuracy Amendment 1《卧轴内圆磨床检验条件 精度检验 修改件1》.pdf ISO 2407 AMD 1-2016 Test conditions for internal cylindrical grinding machines with horizontal spindle - Testing of accuracy Amendment 1《卧轴内圆磨床检验条件 精度检验 修改件1》.pdf
  • ISO 2407-1997 Test conditions for internal cylindrical grinding machines with horizontal spindle - Testing of accuracy《卧轴内圆磨床检验条件 精度检验》.pdf ISO 2407-1997 Test conditions for internal cylindrical grinding machines with horizontal spindle - Testing of accuracy《卧轴内圆磨床检验条件 精度检验》.pdf
  • ISO 24095-2009 Workplace air - Guidance for the measurement of respirable crystalline silica《工作场所空气 适于呼吸的结晶二氧化硅的测定指南》.pdf ISO 24095-2009 Workplace air - Guidance for the measurement of respirable crystalline silica《工作场所空气 适于呼吸的结晶二氧化硅的测定指南》.pdf
  • ISO 24097-1-2017 Intelligent transport systems - Using web services (machine-machine delivery) for ITS service delivery - Part 1 Realization of interoperable we.pdf ISO 24097-1-2017 Intelligent transport systems - Using web services (machine-machine delivery) for ITS service delivery - Part 1 Realization of interoperable we.pdf
  • 相关搜索

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

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