【计算机类职业资格】程序员-24 (1)及答案解析.doc

上传人:dealItalian200 文档编号:1336108 上传时间:2019-10-17 格式:DOC 页数:7 大小:42.50KB
下载 相关 举报
【计算机类职业资格】程序员-24 (1)及答案解析.doc_第1页
第1页 / 共7页
【计算机类职业资格】程序员-24 (1)及答案解析.doc_第2页
第2页 / 共7页
【计算机类职业资格】程序员-24 (1)及答案解析.doc_第3页
第3页 / 共7页
【计算机类职业资格】程序员-24 (1)及答案解析.doc_第4页
第4页 / 共7页
【计算机类职业资格】程序员-24 (1)及答案解析.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、程序员-24 (1)及答案解析(总分:51.00,做题时间:90 分钟)一、试题一(总题数:1,分数:6.00)【函数 1.2 说明】 函数 merge(int a,int n,int b,int m,int *c)是将两个从小到大有序数组 a 和 b 复制合并出一个有序整数序列 c,其中形参 n 和 m 分别是数组 a 和 b 的元素个数。 【函数 1.2】 void merge(int a ,int n,int b ,int m,int *c) int i,j; for(i=j:0;in /纯虚拟函数 ; class Rectangle: 1 protected: double heigh

2、t; double width; public: Rectangle(); Rectangle( double height, double width) thisheight = height; thiswidth = width; double getGirth ( ) return 2 ; ; class Square: 3 public: Square( double width) 4 ; ; class Triangle: 5 double la; double lb; double lc; public: Triangle( double la,double lb,double l

3、c) thisla = la; thisLb = lb; thislc = lc; double getGirth ( ) return la + lb + lc; ; void main( ) Figure * figures = new Triangle ( 2,3,3 ),new Rectangle (5,8) , new Square 5 ; for (inti =0;i3;i+) cout “figures “ i “ girth =“ ( figures i ) getGirth ( ) end1; (分数:15.00)程序员-24 (1)答案解析(总分:51.00,做题时间:90

4、 分钟)一、试题一(总题数:1,分数:6.00)【函数 1.2 说明】 函数 merge(int a,int n,int b,int m,int *c)是将两个从小到大有序数组 a 和 b 复制合并出一个有序整数序列 c,其中形参 n 和 m 分别是数组 a 和 b 的元素个数。 【函数 1.2】 void merge(int a ,int n,int b ,int m,int *c) int i,j; for(i=j:0;in /纯虚拟函数 ; class Rectangle: 1 protected: double height; double width; public: Rectang

5、le(); Rectangle( double height, double width) thisheight = height; thiswidth = width; double getGirth ( ) return 2 ; ; class Square: 3 public: Square( double width) 4 ; ; class Triangle: 5 double la; double lb; double lc; public: Triangle( double la,double lb,double lc) thisla = la; thisLb = lb; thi

6、slc = lc; double getGirth ( ) return la + lb + lc; ; void main( ) Figure * figures = new Triangle ( 2,3,3 ),new Rectangle (5,8) , new Square 5 ; for (inti =0;i3;i+) cout “figures “ i “ girth =“ ( figures i ) getGirth ( ) end1; (分数:15.00)解析:public Figure解析 类 Figure 是类 Rectangle 的父类,这里应当填入 public Figu

7、re。解析:(height+ width)*2解析 方法 getGirth()返回矩形的周长,即(height+ width)*2。解析:Public Rectangle解析 矩形类 Rectangle 是正方形类 Square 的父类,这里当填入 public Rectangle。解析:height=thiswidth=width解析 这是正方形类 Square 的构造函数,它的“长”和“宽”都是width,所以应填入 height=thiswidth=width。其中第二个 width 是传入的参数。解析:public Figure解析 类 Figure 是类 Triangle 的父类,这里当填入 public Figure。

展开阅读全文
相关资源
猜你喜欢
  • ASTM A291 A291M-2017 Standard Specification for Steel Forgings Carbon and Alloy for Pinions Gears and Shafts for Reduction Gears《用于减速齿轮的齿轴 齿轮和轴的钢锻件 碳和合金的标准规格》.pdf ASTM A291 A291M-2017 Standard Specification for Steel Forgings Carbon and Alloy for Pinions Gears and Shafts for Reduction Gears《用于减速齿轮的齿轴 齿轮和轴的钢锻件 碳和合金的标准规格》.pdf
  • ASTM A291 A291M-2018 Standard Specification for Steel Forgings Carbon and Alloy for Pinions Gears and Shafts for Reduction Gears《用于减速齿轮的齿轴 齿轮和轴的钢锻件 碳和合金的标准规格》.pdf ASTM A291 A291M-2018 Standard Specification for Steel Forgings Carbon and Alloy for Pinions Gears and Shafts for Reduction Gears《用于减速齿轮的齿轴 齿轮和轴的钢锻件 碳和合金的标准规格》.pdf
  • ASTM A295 A295M-2005 Standard Specification for High-Carbon Anti-Friction Bearing Steel《高碳耐磨轴承钢标准规范》.pdf ASTM A295 A295M-2005 Standard Specification for High-Carbon Anti-Friction Bearing Steel《高碳耐磨轴承钢标准规范》.pdf
  • ASTM A295 A295M-2009 Standard Specification for High-Carbon Anti-Friction Bearing Steel《高碳耐磨轴承钢标准规范》.pdf ASTM A295 A295M-2009 Standard Specification for High-Carbon Anti-Friction Bearing Steel《高碳耐磨轴承钢标准规范》.pdf
  • ASTM A295 A295M-2014 Standard Specification for High-Carbon Anti-Friction Bearing Steel《高碳耐磨轴承钢的标准规格》.pdf ASTM A295 A295M-2014 Standard Specification for High-Carbon Anti-Friction Bearing Steel《高碳耐磨轴承钢的标准规格》.pdf
  • ASTM A297 A297M-2008 Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application.pdf ASTM A297 A297M-2008 Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application.pdf
  • ASTM A297 A297M-2008a Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application《通用耐热铬铁与镍铬铁合金钢铸件的标准规格》.pdf ASTM A297 A297M-2008a Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application《通用耐热铬铁与镍铬铁合金钢铸件的标准规格》.pdf
  • ASTM A297 A297M-2010 Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application《通用设施用耐热铁-铬和铁-铬-镍钢铸件的标准规范》.pdf ASTM A297 A297M-2010 Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application《通用设施用耐热铁-铬和铁-铬-镍钢铸件的标准规范》.pdf
  • ASTM A297 A297M-2014 Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application《通用耐热性铁-铬和铁-铬-镍钢铸件的标准规范》.pdf ASTM A297 A297M-2014 Standard Specification for Steel Castings Iron-Chromium and Iron-Chromium-Nickel Heat Resistant for General Application《通用耐热性铁-铬和铁-铬-镍钢铸件的标准规范》.pdf
  • 相关搜索

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

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