-
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
-
cqicm
基于欧几里得距离的聚类分析,插值与拟合的matlab实现,实现六自由度运动学逆解算法。( Clustering analysis based on Euclidean distance, Interpolation and fitting matlab implementation, Six degrees of freedom to achieve inverse kinematics algorithm.)
- 2017-04-17 15:03:40下载
- 积分:1
-
power-system-simulation-
电力系统仿真技术,主要是matlab环境下的电力系统仿真研究(Power system simulation technology, mainly is the matlab environment simulation of power system)
- 2013-04-21 20:03:16下载
- 积分:1
-
CPN
cpn算法例程,主要用c++实现,分两层实现,等等,自己看吧,(CPN algorithm routines, the main c++ achieved, divided into two levels to achieve, and so on, their own look,)
- 2008-12-16 11:06:32下载
- 积分: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
-
m
说明: 基于MATLAB图像处理的应用及参考代码(MATLAB-based image processing applications and reference code)
- 2009-03-22 11:44:26下载
- 积分:1
-
DTMF
该软件可以解析声音信号中的dtmf编码,值得下载一试。(The software can resolve the dtmf encoding sound signals)
- 2010-08-03 22:41:51下载
- 积分:1
-
bianyuantiqu
在Matlab中运用边缘提取的方法,对图像中的特征图形进行边缘提取(By using the methods of edge extraction in Matlab, the edge feature extraction of graphic image of the)
- 2014-11-22 15:18:34下载
- 积分:1
-
wenMatlabFit_dn05
利用Matlab工具在VC dotNet中实现聚点拟合以及直径测算的程序(Matlab tool in achieving VC dotNet accumulation diameter calculation and fitting procedures)
- 2007-04-26 04:37:00下载
- 积分:1
-
CandMatlab
一个典型的MATLAB河VC++的混合编程,对刚刚起步学习的人很有帮助(a typical VC MATLAB River mixed programming, which has just started to learn the helpful)
- 2006-06-08 17:21:53下载
- 积分:1