📄 teacher_worker.h
字号:
#include"worker.h"
#include"teacher.h"
class teacher_worker:public teacher,public worker
{
friend class list;
public:
teacher_worker()
{
worker();
teacher();
}
teacher_worker(char *name1,int num,char *sex1,char *birth,char *depart,char *major0,char*post0,char *depart1,char *post00)
:common_people(name1,num,sex1,birth),
teacher(name1,num,sex1,birth,depart,major0,post0),
worker(name1,num,sex1,birth,depart1,post00)
{}
void print();
void getnode();
void sav(char *nam);
};
//
void teacher_worker::sav(char *nam)
{
ofstream fileout(nam,ios_base::app);
fileout<<5<<endl<<type<<endl<<number<<endl<<name<<endl<<sex<<endl<<birthday<<endl<<maths<<endl<<computer<<endl<<english<<endl;
fileout<<department2<<endl<<major2<<endl<<post1<<endl;
fileout<<department3<<endl<<post2<<endl;
fileout.close();
}
//
void teacher_worker::print()
{
cout<<"as a teacher:"<<endl;
teacher::print();
cout<<"as a worker:"<<endl;
cout<<"工作部门:"<<department3<<" 职位:"<<post2<<endl;
}
//
void teacher_worker::getnode()
{
ptr=new teacher_worker(name,number,sex,birthday,department2,major2,post1,department3,post2);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -