资源描述:
《高校人员信息管理系统设计.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、//高校人员信息管理系统设计//#include"stdafx.h"#include"cstring"#include"iostream"#include"fstream"#include"windows.h"usingnamespacestd;classEmployee//员工{protected:intnum;//编号charname[20];//姓名intage;//年龄charsex[5];//等待人数public:char*getname()//获得姓名{returnname;}intgetage()//获得年龄{returnage;}intge
2、tnum()//获编号{returnnum;}char*getsex()//获人性别{returnsex;}voidsetname(chara[])//设置{strcpy(name,a);}voidsetage(inta)//设置{age=a;}voidsetnum(inta)//设置{num=a;}voidsetsex(chara[])//设置{strcpy(sex,a);}};////////////////////////////////classTeacher:virtualpublicEmployee{protected:charbranch1[
3、20];//部门charmajor1[20];//专业charhonour1[30];//职称public:voidsetbranch1(chara[])//设置{strcpy(branch1,a);}char*getbranch1()//获得姓名{returnbranch1;}voidsetmajor1(chara[])//设置{strcpy(major1,a);}char*getmajor1()//获得姓名{returnmajor1;}voidsethonour1(chara[])//设置{strcpy(honour1,a);}char*gethono
4、ur1()//获得姓名{returnhonour1;}voidshow(){printf("编号:%-5d姓名:%-9s年龄:%3d性别:%3s",num,name,age,sex);printf("部门:%-9s专业:%-9s职称:%-9s性别:%3s",branch1,major1,honour1);}};//////////////////////////////////classLaboratory:publicEmployee{private:charlaborator2[60];//所在实验室charmajor2[20];//职务pub
5、lic:voidsetmajor2(chara[])//设置{strcpy(major2,a);}char*getmajor2()//获得姓名{returnmajor2;}voidsetlaborator2(chara[])//设置{strcpy(laborator2,a);}voidshow(){printf("编号:%-5d姓名:%-9s年龄:%3d性别:%3s",num,name,age,sex);printf("所在实验室:%-20s职务:%-16s",laborator2,major2);}};//////////////////////
6、//classAdministrative:virtualpublicEmployee//行政人员{protected:charmajor3[20];//政治面貌charhonour3[20];//职称public:voidsetmajor3(chara[])//设置{strcpy(major3,a);}char*getmajor3()//获得姓名{returnmajor3;}voidsethonour3(chara[])//设置{strcpy(honour3,a);}char*gethonour3()//获得姓名{returnhonour3;}voids
7、how(){printf("编号:%-5d姓名:%-9s年龄:%3d性别:%3s",num,name,age,sex);printf("政治面貌:%-10s职称:%-16s",major3,honour3);}};classTandA:publicTeacher,publicAdministrative{public:voidshow(){printf("编号:%-5d姓名:%-9s年龄:%3d性别:%3s",num,name,age,sex);printf("部门:%-9s专业:%-9s职称:%-9s性别:%3s",branch1,maj
8、or1,honour1);printf("政治面貌:%-10s职称