文件名称:Teacher_Cadre
介绍说明--下载内容来自于网络,使用问题请自行百度
分别定义教师类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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.