teacher_worker.h

来自「用C++编写的教师学生相关信息和统计系统」· C头文件 代码 · 共 47 行

H
47
字号
#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 + =
减小字号Ctrl + -
显示快捷键?