文件名称:Teacher_Cadre
- 所属分类:
- 控制台(字符窗口)编程
- 资源属性:
- [WORD]
- 上传时间:
- 2013-01-07
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- 王*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
分别定义教师类Teacher和干部类Cadre,采用多重继承的方式由这两个类派生出新类Teacher_Cadre(教师兼干部类)。要求:
(1)在两个基类中都包含姓名、年龄、性别、地址、电话数据成员。
(2)在Teacher类中还包含数据成员职称title,在Cadre类中还包含数据成员职务post,在Teacher_Cadre类中还包含数据成员工资wage。
(3)对两个基类中的姓名、年龄、性别、地址、电话数据成员用相同的名字,在访问这类数据成员时,指定作用域。
(4)在类体中声明成员函数,在类外定义成员函数。
(5)在派生类Teacher_Cadre的成员函数show中调用Teacher类中的display函数,输出姓名、年龄、性别、地址、电话,然后再用cout语句输出职务和工资。
-Teacher Class Teacher and cadres class of its Cadre are defined using multiple inheritance to derive from two classes a new class Teacher_Cadre (teachers Chairman cadres class). Requirements: (1) in the two base classes include name, age, sex, address, telephone and data members. (2) Teacher class also contains data members titles title Cadre class also contains data members positions POST wage WAGE also Teacher_Cadre class contains data members. (3) the names of the two base class, age, gender, address, telephone and data members with the same name, specify the scope, access to such data members. (4) member functions defined outside the class member function declaration in the class body. (5) in the derived class Teacher_Cadre member function show the Teacher class display function is called, the output name, age, gender, address, telephone number, then the cout statement output positions and wages.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Teacher_Cadre.doc