-
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
-
sample-nvidia-cpu-gpu
Smple code using Nvidia programs prunted in pdf file
- 2014-10-01 10:59:54下载
- 积分:1
-
Cimple
Simple web chat room 简单网络聊天室(Simple web chat room simple Web chat Room)
- 2018-11-26 16:28:08下载
- 积分:1
-
aes-src-22-11-16
一个用vc编写的aes算法实现,含有128,192,256三种钥匙长度的(a prepared using vc Orangk'aes algorithm, containing 128,192,256 length of the three key)
- 2006-12-05 09:17:18下载
- 积分:1
-
jiaoliudianyakongzhichengx
程序使用飞思卡尔公司提供的Freescale CodeWarrior编译器编写(Program provided by the company using the Freescale Freescale CodeWarrior compiler writers)
- 2013-10-29 09:06:41下载
- 积分:1
-
wr_bmp_demo
数字图象处理算法的演示,包括:图象的DFT和逆DFT,图象的FFT和逆FFT,在图象中加入正弦噪声,图象的模板运算实现图象平滑和锐化等等。(digital image processing algorithms demo, including : Image DFT and inverse DFT, FFT image and inverse FFT, in the image by adding sinusoidal noise, the template image Operational Image sharpening and smoothing and so on.)
- 2005-05-11 16:35:50下载
- 积分:1
-
DHT11
MSP430F5529驱动DHT11,并用带字库的JLX12864显示(MSP430F5529 driver DHT11, and use the font JLX12864 display)
- 2020-11-29 15:49:29下载
- 积分:1
-
Direct
图像分割,完整程序,验证可行。新手上传,望支持。(image direct)
- 2012-05-04 22:25:30下载
- 积分:1
-
CheckManage
这是基于SqlServer 2005数据库的考勤管理系统,界面用MFC实现,里面有源码和数据库备份文件。(This is based on attendance SqlServer 2005 database management system, interface with the MFC implementation, which has source code and database backup files.)
- 2009-11-21 13:23:17下载
- 积分:1
-
TSMS-20090629
说明: 程序有以下功能:C#开发
发送短信;
根据发送者和短信内容拦截短信(不完全);
通过向运行此程序的Windows Mobile手机发短信控制其打电话、发短信、开关机。(Program has the following features: C# developers to send text messages the content of messages based on sender and message interception (incomplete) to run this program through the Windows Mobile phones to send text messages to control their phone calls, send text messages, switch machines.)
- 2011-03-21 09:25:02下载
- 积分:1