-
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
-
yqsfy
说明: TSP问题蚁群算法通用Matlab程序源码(Ant colony algorithm for TSP problem common Matlab source code)
- 2010-04-02 16:52:29下载
- 积分:1
-
SERBER
说明: 用matlab 是实现qpsk的方针算法,并计算方针和理论的符号错误率和比特错误率~~请大家指正(Qpsk with matlab is to achieve the policy algorithm, and calculate the principle and theory of symbol error rate and bit error rate ~ ~ please correct me)
- 2010-04-24 09:56:45下载
- 积分:1
-
faceidpro
MATLAB source code. You can find useful address here.
- 2011-04-20 17:56:36下载
- 积分:1
-
practical-image-classification-code-only.tar
practical image classification
- 2014-10-06 18:40:40下载
- 积分:1
-
matlab
基于DCT的图像处理,MATLAB例程。。。。。。、(DCT-based image processing, MATLAB routines. . . . . . ,)
- 2014-02-12 16:44:32下载
- 积分:1
-
Dynamic_Copula_Toolbox_3.0
贡献一个Dynamic Copula Toolbox 3.0资源(Contribution to a Dynamic Copula Toolbox 3.0 Resource)
- 2014-07-03 21:23:14下载
- 积分:1
-
maomao
连续相位调制信号(CPM)产生,毕设内容,高光谱图像基本处理,阵列信号处理的高分辨率估计。( Continuous phase modulation signal (CPM) to produce, Complete set content, basic hyperspectral image processing, High-resolution array signal processing estimates.)
- 2016-08-29 15:30:05下载
- 积分:1
-
rectifier
bridge rectifier circuit that shows how out-of-phase the current is with respect to voltage
- 2013-08-09 16:15:43下载
- 积分:1
-
spinvalve
本程序用来模拟当前研究很热门的自旋阀满足的LLG方程,并作图研究其性态。具体数据公式文件包里有详细说明(the procedures used to simulate the current research is very popular spin valves to meet the LLG equation, and mapping study its behavior. Specific data document bundle formula are described in detail)
- 2007-04-24 21:53:51下载
- 积分:1