-
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
-
人工势场法(3维alpha)
人工势场三维仿真图,程序可以运行。。。。。。。。(Artificial potential field three-dimensional simulation diagram , the program can run.)
- 2021-02-21 22:49:41下载
- 积分:1
-
Keil C51编译、调试软件使用指南
说明: 该手册是 Keil 软件公司 8051 单片机软件开发工具的介绍 是为新用户和有兴趣的读者准备的使用指南 只需要阅读本书就可以正确地运行和使用该软件(This manual is the introduction of 8051 single chip microcomputer software development tool of keil software company. It is a guide for new users and interested readers to use the software correctly only by reading this book)
- 2020-04-29 15:54:03下载
- 积分:1
-
deadband_pid.m
带死区的PID算法,在MATLAB语言编写,仿真效果不错。(Dead-zone of the PID algorithm, the MATLAB language, simulation results are good.)
- 2009-12-08 09:51:57下载
- 积分:1
-
wasdewf
小游戏开发实例。里面有很多小游戏的源代码以及解说。(games source code)
- 2011-11-29 20:33:18下载
- 积分:1
-
WPF 串行通讯的例子
WPF 串行通讯的例子︰ 读取、 连接、 发送二进制数据的端口
- 2022-03-24 22:42:06下载
- 积分:1
-
基本的粒子群优化算(c语言实现),
代码注释详细,一共只有三个函数,结构清晰。可读性强,直接修改适应度函数就可以求解不同的优化问题。
- 2022-07-27 23:28:24下载
- 积分:1
-
Csharp-internet-programming
C#网络编程基础一书的所有例子,涵盖从SOCKET到加密的所有功能,值得学习(C# Network Programming, a book of all the examples, ranging from SOCKET to encrypt all the features, it is worth learning)
- 2011-12-23 17:31:39下载
- 积分:1
-
Mixture_of_VC_and_Matlab_programming
VC与Matlab的混合编程方法及其应用
详细介绍了VC与Matlab混合编程的方法和实例,适合初步接触混合编程的人使用。(Mixture of VC and Matlab programming and application details of the VC and Matlab programming methods, and case mix for the initial contact with mixed programming to use.)
- 2010-06-12 16:15:04下载
- 积分:1
-
vfwwnd
我近期从事视频开发所以将我参考的资料上传给大家看看。(I recently engaged in video development, therefore, refer to the information I upload to the U.S. to see.)
- 2008-07-02 11:33:12下载
- 积分:1