C++第五次实验
来源:互联网 发布:复杂网络画图 编辑:程序博客网 时间:2024/05/17 04:30
- #include<iostream>
- #include<string>
- using namespace std;
- class Teacher
- {
- public:
- Teacher(string n,string s,int a,string t);
- void display();
- string sex;
- string name;
- int age;
- string title;
- };
- Teacher::Teacher(string n,string s,int a,string t)
- { name=n;sex=s;age=a;title=t; }
- void Teacher::display()
- {
- cout<<"姓名"<<name<<endl;
- cout<<"性别"<<sex<<endl;
- cout<<"年龄"<<age<<endl;
- cout<<"职称"<<title<<endl;
- }
- class Cadre
- {
- public:
- Cadre(string n,string s,int a,string p);
- string sex;
- string name;
- int age;
- string post;
- };
- Cadre::Cadre(string n,string s,int a,string p)
- {
- name=n;sex=s;age=a;post=p;
- }
- class Teacher_Cadre:public Teacher,public Cadre
- {
- public:
- Teacher_Cadre(string n,string s,int a,string t,string p,double w);
- void show();
- double wages;
- };
- Teacher_Cadre::Teacher_Cadre(string n,string s,int a,string t,string p,double w):Teacher(n,s,a,t),Cadre(n,s,a,p),wages(w){}
- void Teacher_Cadre::show()
- {
- display();
- cout<<"职务"<<post<<endl;
- cout<<"薪水"<<wages<<endl;
- }
- int main()
- {
- Teacher_Cadre t1("曾辉","男",42,"副教授","主任",1534.5);
- t1.show();
- return 0;
- }
0 0
- 第五次C语言上机实验报告
- 第五次C程序设计实验报告
- 第五次C语言上机实验报告
- C语言第五次上机实验
- 第五次实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次实验报告
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- 第五次上机实验
- Caused by: java.lang.OutOfMemoryError: PermGen space
- caffe学习笔记(4):lr_policy之各模型形式的总结
- Android参考资料
- C++第六次上机作业
- C#/.NET 基础学习
- C++第五次实验
- 34. Search for a Range
- Mac&iOS Socket
- Android ViewPager 循环轮播
- Top K Frequent Elements
- 源码解析ConcurrentHashMap
- spring容器加载完毕做一件事情(利用ContextRefreshedEvent事件)
- IOS开发-利用绘图表示进度
- JS面向对象定义多个属性--object.defineProperties()方法