文件名称:teacher
介绍说明--下载内容均来自于网络,请自行研究使用
分别定义教师类Teacher和干部类Cadre,采用多重继承的方式由这两个类派生出新类Teacher_Cadre(教师兼干部类)。要求:
(1)在两个基类中都包含姓名、年龄、性别、地址、电话数据成员。
(2)在Teacher类中还包含数据成员职称title,在Cadre类中还包含数据成员职务post,在Teacher_Cadre类中还包含数据成员工资wage。
(3)对两个基类中的姓名、年龄、性别、地址、电话数据成员用相同的名字,在访问这类数据成员时,指定作用域。
(4)在类体中声明成员函数,在类外定义成员函数。
(5)在派生类Teacher_Cadre的成员函数show中调用Teacher类中的display函数,输出姓名、年龄、性别、地址、电话,然后再用cout语句输出职务和工资。
-Defining Teacher class Cadre of the Teacher and the class Cadre, respectively with the method of multiple inheritance by the two classes derive new Teacher_Cadre cadres (Teacher and class). Requirements:
(1) in the two base class contains name, age, gender, address, telephone, data members.
(2) the Teacher class also contains the data member title title, also contains data members in the class Cadre duty post, Teacher_Cadre class also contains the data members pay wage.
(3) of two base class name, age, gender, address, telephone, data members with the same name, on a visit to the class data members, the specified scope.
(4) in a class member function declaration in the body, outside the class define a member function.
(5) in the derived class member functions Teacher_Cadre show called the Teacher in the class the display function, the output name, age, gender, address, telephone, and then use cout statement output position and salary.
(1)在两个基类中都包含姓名、年龄、性别、地址、电话数据成员。
(2)在Teacher类中还包含数据成员职称title,在Cadre类中还包含数据成员职务post,在Teacher_Cadre类中还包含数据成员工资wage。
(3)对两个基类中的姓名、年龄、性别、地址、电话数据成员用相同的名字,在访问这类数据成员时,指定作用域。
(4)在类体中声明成员函数,在类外定义成员函数。
(5)在派生类Teacher_Cadre的成员函数show中调用Teacher类中的display函数,输出姓名、年龄、性别、地址、电话,然后再用cout语句输出职务和工资。
-Defining Teacher class Cadre of the Teacher and the class Cadre, respectively with the method of multiple inheritance by the two classes derive new Teacher_Cadre cadres (Teacher and class). Requirements:
(1) in the two base class contains name, age, gender, address, telephone, data members.
(2) the Teacher class also contains the data member title title, also contains data members in the class Cadre duty post, Teacher_Cadre class also contains the data members pay wage.
(3) of two base class name, age, gender, address, telephone, data members with the same name, on a visit to the class data members, the specified scope.
(4) in a class member function declaration in the body, outside the class define a member function.
(5) in the derived class member functions Teacher_Cadre show called the Teacher in the class the display function, the output name, age, gender, address, telephone, and then use cout statement output position and salary.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2.3.cpp