-
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
-
Sequence
1234...n顺序进栈,计算出栈的可能序列并输出(Stack input in the sequence of 1234...n,compute the possible sequences of output
)
- 2014-11-18 13:57:33下载
- 积分:1
-
VC++matlab
VC++和matlab主要用于图像处理的源程序。(VC and Matlab mainly for image processing of the source.)
- 2007-07-02 13:30:14下载
- 积分:1
-
matlab
说明: matlab课件及程序例讲解以及matlab算法实例文件(PDF)格式(courseware and procedures matlab matlab algorithm cases and practical examples to explain (PDF) format)
- 2011-03-24 21:46:33下载
- 积分:1
-
isctest
matlab程序,一种快速ICA算法,用于混合信号盲分离,可应用于通信系统信号处理(matlab program, a fast ICA algorithm for blind separation of mixed signals, signal processing can be used in communication systems)
- 2013-11-08 19:12:37下载
- 积分:1
-
MUSIC
说明: MUSIC 算法的实现原理 及其流程 数字信号处理(MUSIC algorithm implementation process of digital signal processing theory and)
- 2011-04-02 22:48:31下载
- 积分:1
-
h.245-c
H.245是H.323协议族中用于媒体信道控制的协议主要完成多媒体通信中每个逻辑通道的建立维护和释放具(H.245 is a protocol for H.323 protocol suite in the main media channels control the completion of the establishment of multimedia communication in each logical channel maintenance and release of a)
- 2014-08-28 20:24:11下载
- 积分:1
-
Match-Template
卡尔曼滤波不错的程序,很实用,大家好好研究一起分享一起进步吧(Kalman filtering good program, very practical, we make good progress in research to share with the Bar)
- 2010-01-12 19:39:11下载
- 积分:1
-
VCandMatlab
许多工程软件需要用到复杂的数学算法。VC++能够形成各种用户界面, 并可以直接与系统及底层硬件交换数据。因此研究VC++和Matlab 的混合编程具有很大的实际意义。该文讨论了如何使用Matlab 的Complier 将*.m函数编译为动态链接库DLL, 提供给VC++调用的方法, 提供了一种VC++与Matlab 混合编程的快速实现。(Many engineering software need to use complex mathematical algorithms. VC++ can form a variety of user interface, and can directly exchange data systems and the underlying hardware. Therefore, VC++ and Matlab of mixed programming of great practical significance. The article discusses how to use Matlab' s Complier to*. m functions compiled as dynamic link library DLL, VC++ provided to the invoked method, provides a mixed VC++ and Matlab programming fast implementation.)
- 2010-06-06 15:59:47下载
- 积分:1
-
program
matlab音乐合成,非常实用,信号与系统大作业(matlab)
- 2010-08-30 10:30:45下载
- 积分:1