-
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
-
structure-Yagi-
八木天线有源折合振子馈电的新结构 (The new structure Yagi antenna active equivalent oscillator fed)
- 2013-11-29 12:53:07下载
- 积分:1
-
pro
以及简易倒立摆,实现一级PID建议算法控制倒立摆不倒的程序,仅做参考(yi ji jian y idao li bai)
- 2013-10-23 16:52:50下载
- 积分:1
-
TaskManagerExSrc
Not only incredibly useful utility for managing processes, but great tool for learning about the Task Manager
- 2007-10-22 13:33:43下载
- 积分:1
-
embedded-systems
基于 嵌 入式系 统 理 论和 容 错系 统 体系 结 构, 结 合故障 一 安 全电 路的 设计 理念, 给出 了 一 种 嵌
入式 二乘 二 取 二容 错计算 机 联锁系 统的 硬件 设计. 深 入阐 述了 系 统 硬件电 路的 设计理论依据和工
作原 理, 同 时 给出了 设计中 的 元 件选型. 通过功能 测试, 系 统设计符 合故障 一 安全的 设计原则, 理论
计 算 表明, 其可 靠 性、 安全 性 达 到 铁 路 信号系 统 要求(Based on the theory of embedded systems and fault-tolerant system architecture, combining design fail-safe circuitry, gives a socketed
Take two squares two-in fault-tolerant computer interlocking system hardware design. Further expounded on system hardware circuit design theory and work
Design principles for the principle, and gives the design of the component selection through functional testing, failure of a safety system designed to meet the theoretical
Calculations show that the reliability, security, railway signaling system requirements to achieve)
- 2014-01-19 21:42:09下载
- 积分:1
-
Fuzzocess
模糊专家控制在制浆中段废水好氧处理过程中的应用Fuzzy expert control aerobic treatment of wastewater in the Pulping Process(Fuzzy expert control aerobic treatment of wastewater in the Pulping Process)
- 2011-02-15 20:43:42下载
- 积分:1
-
windbg
NT4 component WinDbg source for developer reference
- 2015-02-10 04:19:38下载
- 积分:1
-
-plasticity-
一篇运动硬化的文章,英文原版,Implementation of cyclic plasticity models based on
a general form of kinematic hardening(A kinematic hardening of the article, the original English,Implementation of cyclic plasticity models based on
a general form of kinematic hardening)
- 2014-01-06 15:07:56下载
- 积分:1
-
VSplitterCtrlSnk
VSplitterCtrlSnk.cls 可将窗口分为两部分并可随意调整大小的类(VSplitterCtrlSnk.cls window can be divided into two parts may arbitrarily large adjustment small type)
- 2007-01-19 10:31:42下载
- 积分:1
-
MATLABVCVB
在学校图书馆下的MATLAB混合编程的书,对MATLAB的接口有详细介绍,特别是初学者,对mxArray不熟悉者。(At the school library under the mixed MATLAB programming book on the MATLAB interface has a detailed introduction, especially beginners, to those who are not familiar with the mxArray.)
- 2009-03-06 09:07:46下载
- 积分:1