-
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
-
mixure
vc和matlab的混合编程,很好很全的(vc and matlab programming mix, full of very good)
- 2011-11-23 20:59:18下载
- 积分:1
-
MIKOV-FUNCTION
学习matlab的方程小程序,没问题额的啊(Learning matlab equation applet, the amount is no problem)
- 2011-09-27 08:32:09下载
- 积分:1
-
golden
欢迎下载,MATLAB求函数极小值的程序(Welcome to download, MATLAB function for the minimum procedures)
- 2008-01-10 14:25:40下载
- 积分:1
-
code-RGB-to-HSV
matlab code to transform RGB into HCV
- 2014-10-06 08:06:29下载
- 积分:1
-
Density_Evolution
LDPC码理论方面的高性能密度进化仿真测试例程,可以跑出数值结果(LDPC DENSITY EVOLUTION)
- 2013-10-03 16:49:20下载
- 积分:1
-
C-language-realization-of-MATLAB-
本文着重描述了运用MATLAB命令将M文件翻译为C语言程序,并修改为可直接调用的C语言函数的方法,(This paper describes the use of MATLAB command M-file translation for the C language program, and modify the method can directly call C language functions)
- 2012-06-26 00:05:30下载
- 积分:1
-
calculateflow_BX_Final
电力系统潮流计算,基于BX快速解耦算法,对IEEE14节点标准拓扑网络进行检测,能够正确快速地计算出结果。(Power flow calculation based BX fast decoupled algorithm, IEEE14 standard topology network node detection, able to correctly calculate the results quickly.)
- 2013-05-24 15:59:57下载
- 积分:1
-
fastica1
很清晰的fastica算法,主要是有关主元分析的程序,很好的,自己编的,有不会的 可以咨询(it s a progress which is fastica)
- 2013-09-13 23:41:08下载
- 积分:1
-
OpenTLD-master
TLD跟踪算法源代码下载(纯C++版本),OpenTLD-master,某大牛重新编写的C++版本TLD跟踪算法,脱离MATLAB。(C++ impleletion of TLD)
- 2014-01-16 21:18:38下载
- 积分:1