-
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
-
RTKLIB_usrmanul
RTKLIB单频RTK使用UBLOX和skytraq的实现方式,可以是连接CORS也可以是两个模块方式。(rtklib rtk usrmanul)
- 2014-08-29 08:51:23下载
- 积分:1
-
MATLAB6.5Assisted-image-processing
本文利用Matlab对辅助图像处理做了一个全面的介绍,对初学图像处理的朋友很有帮助(It has benefits for learners)
- 2010-08-30 09:25:00下载
- 积分:1
-
prog1
通信原理实验生成软件及相关代码,调制解调(C生成)(Communication principle experiment generation software and related codes, modulation and demodulation (C generated))
- 2014-09-17 20:13:40下载
- 积分:1
-
feige
install code to the document,and replease ,make project
- 2007-11-14 10:47:46下载
- 积分:1
-
OSTU
二维OSTU方法 ,能够自动给出合适阈值 matlab环境下开发(Two-dimensional OSTU method that can automatically give the appropriate thresholds developed under matlab environment)
- 2011-11-07 10:48:47下载
- 积分:1
-
lab2.2
prgramm that calculates the greatest common factor of two numbers
- 2013-11-11 07:02:59下载
- 积分:1
-
dxSample
Example DexExpress Gricontrol
- 2014-10-13 02:52:35下载
- 积分:1
-
PSNRSSIM_matlab
matlab计算两幅图片之间的psnr和ssim值,彩色图片,算法是转换为YUV计算的,YCbCr(matlab computing psnr and ssim value between two pictures, color pictures, the algorithm is converted to YUV calculation, YCbCr)
- 2015-08-28 22:21:18下载
- 积分:1
-
BasicTime
You all might have used CTime or CTimeSpan to manipulate the system timer. Here is an article to show you how your system timer works. I will give you an idea of port communications behind the system clock manipulations. Those who are a little biased on hardware and software interfacing practices would find this article of great help.
- 2007-10-16 09:37:44下载
- 积分:1