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

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

1、国家二级 C+机试(操作题)模拟试卷 367及答案解析(总分:6.00,做题时间:90 分钟)一、基本操作题(总题数:1,分数:2.00)1.使用 VC6打开考生文件夹下的源程序文件 NOdilcpp,该程序运行时有错误,请改正程序中的错误。本程序要求实现的功能为:从键盘输入一个字符串,并将结果保存到文件 modi1txt 中。 注意:不要改动 main函数,不能增行或删行,也不能更改程序的结构,错误的语句在 *error*的下面。 #include #include *error* using std; void WriteFile(char*s) ofstream out1; *error

2、 outlopen(“modiltxt”, binary app); for(int i=0;Si!=0;i+) *error* out1puts(Si); out1close(); Void ClearFile() OfStream outl; outlopen(“modiltxt”); outlclOSe(); int main() char s1 02 4; ClearFile(); cout_二、简单应用题(总题数:1,分数:2.00)2.使用 VC6打开考生文件夹下的源程序文件 modi2cpp。完成空出的函数 fun(int a,int*index),使函数输入 n( #defi

3、me MAXLINE 100 int fun(int a,int*index) void main() int AMAXLINE;int index; int maxdata; maxdata=fun(A, (2)添加语句: priAl(int m,int n):baseA(n)b=m; (3)添加语句:priA2(int m,int n,int k):priAl(n,k) (c=m;) (4) 添加语句: coutgeta()“”getb()cendl;)解析:解析:程序当中定义厂类 baseA、priAl 和 priA2,其中 priA1类由 baseA类公有派生,priA2 类由priA1类公有派生。构造函数是类的一种特殊的成员函数,其函数名和类名一致。构造函数可以带参数也可以不带参数,带参数的构造函数根据构造函数内部赋值语句可知其参数形式。公有派生类可以访问基类的公有成员,因此 priA2类可以调用类 baseA的 geta()函数和 priAl类的 getb()函数,通过调用这两个函数得到基类私有成员 a和 b。

展开阅读全文
相关资源
猜你喜欢
  • EN 3054-1994 en Bearings Airframe Rolling - Single Row Self-Aligning Roller Bearings in Steel Cadmium Plated - Dimensions and Loads《航空航天系列 飞机用轴承 镀铬钢单列球面轴承 尺寸和负载》.pdf EN 3054-1994 en Bearings Airframe Rolling - Single Row Self-Aligning Roller Bearings in Steel Cadmium Plated - Dimensions and Loads《航空航天系列 飞机用轴承 镀铬钢单列球面轴承 尺寸和负载》.pdf
  • EN 3055-1994 en Bearings Airframe Rolling - Single Row Self-Aligning Roller Bearings in Corrosion Resisting Steel - Dimensions and Loads《航空航天系列 飞机机架滚动轴承 不锈钢单列球面轴承 尺寸和负载》.pdf EN 3055-1994 en Bearings Airframe Rolling - Single Row Self-Aligning Roller Bearings in Corrosion Resisting Steel - Dimensions and Loads《航空航天系列 飞机机架滚动轴承 不锈钢单列球面轴承 尺寸和负载》.pdf
  • EN 3057-1994 en Bearings Airframe Rolling - Rigid Double Row Ball Bearings in Steel Cadmium Plated - Dimensions and Loads《航空航天系列轴承 飞机机架滚动轴承 镀镉钢刚性双列滚珠轴承 尺寸和负载》.pdf EN 3057-1994 en Bearings Airframe Rolling - Rigid Double Row Ball Bearings in Steel Cadmium Plated - Dimensions and Loads《航空航天系列轴承 飞机机架滚动轴承 镀镉钢刚性双列滚珠轴承 尺寸和负载》.pdf
  • EN 3058-1994 en Bearings Airframe Rolling - Rigid Double Row Ball Bearings in Corrosion Resisting Steel - Dimensions and Loads《飞机机架滚动轴承 不锈钢双列向心球轴承 尺寸和负载》.pdf EN 3058-1994 en Bearings Airframe Rolling - Rigid Double Row Ball Bearings in Corrosion Resisting Steel - Dimensions and Loads《飞机机架滚动轴承 不锈钢双列向心球轴承 尺寸和负载》.pdf
  • EN 3059-2007 en Aerospace series - Bearings airframe rolling - Rigid single row ball bearings in steel with flanged alignment housing cadmium plated - Dimensions and loads《航空航天系列 飞.pdf EN 3059-2007 en Aerospace series - Bearings airframe rolling - Rigid single row ball bearings in steel with flanged alignment housing cadmium plated - Dimensions and loads《航空航天系列 飞.pdf
  • EN 306-1997 en Heat Exchangers - Methods of Measuring the Parameters Necessary for Establishing the Performance《热交换器 性能确定用参数的测量方法 代替 ENV 306-1990》.pdf EN 306-1997 en Heat Exchangers - Methods of Measuring the Parameters Necessary for Establishing the Performance《热交换器 性能确定用参数的测量方法 代替 ENV 306-1990》.pdf
  • EN 3060-2007 en Aerospace series - Bearings airframe rolling - Rigid single row ball bearings in steel cadmium plated with flanged alignment housing cadmium plated - Dimensions and.pdf EN 3060-2007 en Aerospace series - Bearings airframe rolling - Rigid single row ball bearings in steel cadmium plated with flanged alignment housing cadmium plated - Dimensions and.pdf
  • EN 3061-2007 en Aerospace series - Bearings airframe rolling - Rigid single row ball bearings in corrosion resisting steel with flanged alignment housing - Dimensions and loads《航空航.pdf EN 3061-2007 en Aerospace series - Bearings airframe rolling - Rigid single row ball bearings in corrosion resisting steel with flanged alignment housing - Dimensions and loads《航空航.pdf
  • EN 3063-1994 en Aerospace Series Bolts Double Hexagon Head Close Tolerance Shank Medium Length Thread in Heat Resisting Nickel Base Alloy NI-P101HT (Waspaloy) Classification  1 210.pdf EN 3063-1994 en Aerospace Series Bolts Double Hexagon Head Close Tolerance Shank Medium Length Thread in Heat Resisting Nickel Base Alloy NI-P101HT (Waspaloy) Classification 1 210.pdf
  • 相关搜索

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

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