-
6_1
1. 定义一个抽象学生类CStudent,它具有公有成员函数Average(),该函数用于计算学生的平均分,函数为虚函数;定义一个文科学生类CStudentLiberalArts,它是类CStudent的派生类,并以公有方式派生,它具有的成员有:
1) 保存英语、政治、数学、地理和历史、美术成绩的整形成员变量;
2) 设置上述变量的公有成员函数;
3) 输出上述变量的公有成员函数;
4) 公有的成员函数Average()用于计算学生的平均分;
定义一个理科学生类CStudentScience,它是类CStudent的派生类,并以公有方式派生,它具有的成员为:
1) 保存英语、物理、数学、化学和计算机、程序设计成绩的整形成员变量;
2) 设置上述变量的公有成员函数;
3) 输出上述变量的公有成员函数;
4) 公有的成员函数Average()用于计算学生的平均分;
编写主函数,并测试以下内容:
1) 定义一个CStudent的指针数组pStu,数组长度为4;
2) 动态创建2个文科学生的对象,地址存于pStu数组的0-1个元素内;
3) 动态创建2个理科学生的对象,地址存于pStu数组的2-3个元素内;
4) 利用while循环调用数组里每个元素的计算平均成绩操作;
释放动态分配的空间,确保必要的析构函数能被调用。
(1 define an abstract class student CStudent, it has a public member function Average (), this function is used to calculate the student s average points function as virtual function definition of a liberal arts student class CStudentLiberalArts, it is the class CStudent derived class, and public be derived, which has members are:
1) Save English, shaping member variables politics, mathematics, geography and history, art achievements
2) Set the above variables public member function
3) public member function of the output of the variable
4) public member function Average () is used to calculate the average student s points
The definition of a science student class CStudentScience, it is the class CStudent derived class, and public manner derived, which has members as follows:
1) Save English, physics, mathematics, chemistry and computer programming achievement shaping member variables
2) Set the above variables public member function
3) public member function of t)
- 2014-10-20 15:29:16下载
- 积分:1
-
MATLABVCVB
在学校图书馆下的MATLAB混合编程的书,对MATLAB的接口有详细介绍,特别是初学者,对mxArray不熟悉者。(At the school library under the mixed MATLAB programming book on the MATLAB interface has a detailed introduction, especially beginners, to those who are not familiar with the mxArray.)
- 2009-03-06 09:07:46下载
- 积分:1
-
LEACH.m
LEACH的源代码,详细注释,适合初学WSN路由协议的同学学习。(LEACH source code, detailed notes, WSN routing protocols suitable for novice students to learn.)
- 2014-01-17 21:23:03下载
- 积分:1
-
jianyujiaoben
一个samp的监狱脚本,机不可失失不再来!大家都拿去看看吧(A script samp prison)
- 2014-01-29 20:26:21下载
- 积分:1
-
surce_randon
说明: Randon data from program
- 2019-05-12 01:42:24下载
- 积分:1
-
qxnh00005
用c++编的matlab曲线拟合程序,都是老师布置的数值分析作业!希望和大家交流.谢谢网站提供这个平台!(c addendum to the use of curve fitting procedures Matlab, Layout of the teachers are numerical analysis operations. We hope and exchanges. Thank you for providing this platform!)
- 2006-10-15 20:02:35下载
- 积分:1
-
Matlab_and_VC
vc 和 matlab 混合编程例程,已通过测试(vc and matlab mixed programming routines, has been tested)
- 2007-09-16 10:38:04下载
- 积分:1
-
MexDemo
使用vc6.0与matlab 2010b联合编程,并且测试通过 接口函数的编写(vc6.0 matlab 联合编程)
- 2012-05-06 20:15:30下载
- 积分:1
-
MATLAB-3d-image-reconstruction
基于MATLAB基于MATLAB的三维超声成像及图像处理的三维超声成基于MATLAB的三维超声成像及图像处理像及图像处理(very funny documnet very funny documnet very funny documnet )
- 2015-04-01 07:07:14下载
- 积分:1
-
MACD-Divergence-EA
利用macd背离信号开单,它能省去很多人为的干预,自动交易,避免人性的恐惧和贪婪的弱点!(it use MACD divergence to trade!)
- 2014-10-21 10:43:49下载
- 积分:1