紫金学院C++考试范围预估.docx

上传人:b****3 文档编号:4320251 上传时间:2023-05-07 格式:DOCX 页数:19 大小:1,023.89KB
下载 相关 举报
紫金学院C++考试范围预估.docx_第1页
第1页 / 共19页
紫金学院C++考试范围预估.docx_第2页
第2页 / 共19页
紫金学院C++考试范围预估.docx_第3页
第3页 / 共19页
紫金学院C++考试范围预估.docx_第4页
第4页 / 共19页
紫金学院C++考试范围预估.docx_第5页
第5页 / 共19页
紫金学院C++考试范围预估.docx_第6页
第6页 / 共19页
紫金学院C++考试范围预估.docx_第7页
第7页 / 共19页
紫金学院C++考试范围预估.docx_第8页
第8页 / 共19页
紫金学院C++考试范围预估.docx_第9页
第9页 / 共19页
紫金学院C++考试范围预估.docx_第10页
第10页 / 共19页
紫金学院C++考试范围预估.docx_第11页
第11页 / 共19页
紫金学院C++考试范围预估.docx_第12页
第12页 / 共19页
紫金学院C++考试范围预估.docx_第13页
第13页 / 共19页
紫金学院C++考试范围预估.docx_第14页
第14页 / 共19页
紫金学院C++考试范围预估.docx_第15页
第15页 / 共19页
紫金学院C++考试范围预估.docx_第16页
第16页 / 共19页
紫金学院C++考试范围预估.docx_第17页
第17页 / 共19页
紫金学院C++考试范围预估.docx_第18页
第18页 / 共19页
紫金学院C++考试范围预估.docx_第19页
第19页 / 共19页
亲,该文档总共19页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

紫金学院C++考试范围预估.docx

《紫金学院C++考试范围预估.docx》由会员分享,可在线阅读,更多相关《紫金学院C++考试范围预估.docx(19页珍藏版)》请在冰点文库上搜索。

紫金学院C++考试范围预估.docx

紫金学院C++考试范围预估

范围预估

一、选择题。

(2*10)

1、3道面向过程(第三章至第六章),其中2道与指针有关。

2、7道面向对象(第八章到第十二章),大致重点:

运算符重载、析构、构造、和友元等。

注:

均来自习题集。

二、填空题。

(1*10)

涉及考点:

结构体(第七章:

给结构体成员赋值)、三种继承方式后的权限类型(第十一章)、多态(第十二章:

实现手段、区别),字符串函数(第五章:

strlen、strcpy等)。

注:

主要参考习题集并大致了解书本介绍。

三、判断题。

(1*5)

习题集第八章至第十二章中判断题选其中5道,大概都细看之。

四、程序填空。

(2*10)

1、友元。

(下为可能出现的原题)

2、构造函数。

(下为可能出现的原题)

五、填结果。

(5*5)

1、不同存储类型对象调用构造、析构原则

2、派生类,构造函数调用顺序

 

六、编程题。

(10*2)

1、上机题(书本十一章——9)★★★★★

2、#include

3、#include

4、usingnamespacestd;

5、classTeacher

6、{

7、public:

8、Teacher(stringna,inta,stringsex,stringtit,stringad,stringt);

9、voiddisplay();

10、

11、protected:

12、stringname;

13、intage;

14、stringsex;

15、stringtitle;

16、stringaddr;

17、stringtel;

18、};

19、Teacher:

:

Teacher(stringna,inta,stringsex,stringtit,stringad,stringt):

name(na),age(a),sex(sex),title(tit),addr(ad),tel(t){}

20、voidTeacher:

:

display()

21、{

22、cout<<"name:

"<

23、cout<<"age:

"<

24、cout<<"sex:

"<

25、cout<<"title:

"<

26、cout<<"address:

"<

27、cout<<"tel:

"<

28、}

29、classCadre

30、{

31、public:

32、Cadre(stringna,inta,stringsex,stringp,stringad,stringt);

33、voiddisplay();

34、

35、protected:

36、stringname;

37、intage;

38、stringsex;

39、stringpost;

40、stringaddr;

41、stringtel;

42、};

43、Cadre:

:

Cadre(stringna,inta,stringsex,stringp,stringad,stringt):

name(na),age(a),sex(sex),post(p),addr(ad),tel(t){}

44、voidCadre:

:

display()

45、{

46、cout<<"name:

"<

47、cout<<"age:

"<

48、cout<<"sex:

"<

49、cout<<"post:

"<

50、cout<<"address:

"<

51、cout<<"tel:

"<

52、}

53、classTeacher_Cadre:

publicTeacher,publicCadre

54、{

55、public:

56、Teacher_Cadre(stringna,inta,stringsex,stringtit,stringp,stringad,stringt,floatw);

57、voidshow();

58、

59、private:

60、floatwage;

61、};

62、Teacher_Cadre:

:

Teacher_Cadre(stringna,inta,stringsex,stringt,stringp,stringad,stringtel,floatw):

Teacher(na,a,sex,t,ad,tel),Cadre(na,a,sex,p,ad,tel),wage(w){}

63、voidTeacher_Cadre:

:

show()

64、{

65、Teacher:

:

display();

66、cout<<"post:

"<

:

post<

67、cout<<"wages:

"<

68、}

69、intmain()

70、{

71、Teacher_Cadre

72、xiaoming("小明",25,"男","高级工程师","开发工程师","南京","12345678",1234.5);

73、xiaoming.show();

74、return0;

75、}

12.4★★★

76、#include

77、usingnamespacestd;

78、classShape

79、{

80、public:

81、virtualdoublearea()const=0;

82、};

83、classCircle:

publicShape

84、{

85、public:

86、Circle(doubler):

radius(r){}

87、virtualdoublearea()const{return3.14159*radius*radius;};

88、

89、protected:

90、doubleradius;

91、};

92、classRectangle:

publicShape

93、{

94、public:

95、Rectangle(doublew,doubleh):

width(w),height(h){}

96、virtualdoublearea()const{returnwidth*height;}

97、

98、protected:

99、doublewidth,height;

100、};

101、classTriangle:

publicShape

102、{

103、public:

104、Triangle(doublew,doubleh):

width(w),height(h){}

105、virtualdoublearea()const{return0.5*width*height;}

106、

107、protected:

108、doublewidth,height;

109、};

110、voidprintArea(constShape&s)

111、{

112、cout<

113、}

114、

115、intmain()

116、{

117、Circlecircle(12.6);

118、cout<<"areaofcircle=";

119、printArea(circle);

120、Rectanglerectangle(4.5,8.4);

121、cout<<"areaofrectangle=";

122、printArea(rectangle);

123、Triangletriangle(4.5,8.4);

124、cout<<"areaoftriangle=";

125、printArea(triangle);

126、return0;

127、}

12.5★★★

128、#include

129、usingnamespacestd;

130、classShape

131、{

132、public:

133、virtualdoublearea()const=0;

134、};

135、classCircle:

publicShape

136、{

137、public:

138、Circle(doubler):

radius(r){}

139、virtualdoublearea()const{return3.14159*radius*radius;};

140、

141、protected:

142、doubleradius;

143、};

144、classSquare:

publicShape

145、{

146、public:

147、Square(doubles):

side(s){}

148、virtualdoublearea()const{returnside*side;}

149、

150、protected:

151、doubleside;

152、};

153、

154、classRectangle:

publicShape

155、{

156、public:

157、Rectangle(doublew,doubleh):

width(w),height(h){}

158、virtualdoublearea()const{returnwidth*height;}

159、

160、protected:

161、doublewidth,height;

162、};

163、

164、classTrapezoid:

publicShape

165、{

166、public:

167、Trapezoid(doublet,doubleb,doubleh):

top(t),bottom(t),height(h){}

168、virtualdoublearea()const{return0.5*(top+bottom)*height;}

169、

170、protected:

171、doubletop,bottom,height;

172、};

173、

174、classTriangle:

publicShape

175、{

176、public:

177、Triangle(doublew,doubleh):

width(w),height(h){}

178、virtualdoublearea()const{return0.5*width*height;}

179、

180、protected:

181、doublewidth,height;

182、};

183、intmain()

184、{

185、Circlecircle(12.6);

186、Squaresquare(3.5);

187、Rectanglerectangle(4.5,8.4);

188、Trapezoidtrapezoid(2.0,4.5,3.2);

189、Triangletriangle(4.5,8.4);

190、Shape*pt[5]={&circle,&square,&rectangle,&trapezoid,&triangle};

191、doubleareas=0.0;

192、for(inti=0;i<5;i++)

193、{

194、areas=areas+pt[i]->area();

195、}

196、cout<<"totolofallareas="<

197、return0;

198、}

注:

三道其中之一。

2、

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 工作范文 > 演讲主持

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2