欢迎来到天天文库
浏览记录
ID:40710387
大小:50.50 KB
页数:9页
时间:2019-08-06
《C++程序设计——学生信息管理系统》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、#include"example9_05_person.h"//Date类的函数实现voidDate::Set(inty,intm,intd){year=y;month=m;day=d;}intDate::GetYear(){returnyear;}intDate::GetMonth(){returnmonth;}intDate::GetDay(){returnday;}//Person类的函数实现Person::Person(stringna,stringnum,chars,inty,intm,intd
2、,stringsp,stringre,stringac,intty){name=na;number=num;sex=s;birthday.Set(y,m,d);speciality=sp;researchTopic=re;academicTitle=ac;type=ty;}boolPerson::operator<(Personob)const{if(number3、e;}stringPerson::GetNumber(){returnnumber;}charPerson::GetSex(){returnsex;}DatePerson::GetBirth(){returnbirthday;}stringPerson::GetSpec(){returnspeciality;}stringPerson::GetResearch(){returnresearchTopic;}stringPerson::GetAcademic(){returnacademicTitle;}i4、ntPerson::GetType(){returntype;}#include"example9_05_interface.h"#include#include#include#includeusingnamespacestd;Interface::Interface(){ReadFile();}voidInterface::Display(){cout<5、>choi6、ce;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=7、pe.end()){if(p->GetNumber()==number)break;p++;}if(p==pe.end())cout<<"没有此人信息!";else{cout<<"姓名t编号t性别出生日期t专业t课题t职称t类型";PrintOne(p);}}voidInterface::Insert(){stringname;stringnumber;charsex;inty,m,d;stringspeciality;stringresearchTopic;stringacademi8、cTitle;inttype;charch='n';do{cout<<"你要输入的人员类型(1-学生2-研究生3-在职研究生4-教师):";cin>>type;while(type!=1&&type!=2&&type!=3&&type!=4){cout<<"输入错误,请重新输入";cout<<"你要输入的人员类型(1-学生2-研究生3-在职研究生4-教师):";cin>>type;}cout<<"姓名:";cin>>nam
3、e;}stringPerson::GetNumber(){returnnumber;}charPerson::GetSex(){returnsex;}DatePerson::GetBirth(){returnbirthday;}stringPerson::GetSpec(){returnspeciality;}stringPerson::GetResearch(){returnresearchTopic;}stringPerson::GetAcademic(){returnacademicTitle;}i
4、ntPerson::GetType(){returntype;}#include"example9_05_interface.h"#include#include#include#includeusingnamespacestd;Interface::Interface(){ReadFile();}voidInterface::Display(){cout<5、>choi6、ce;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=7、pe.end()){if(p->GetNumber()==number)break;p++;}if(p==pe.end())cout<<"没有此人信息!";else{cout<<"姓名t编号t性别出生日期t专业t课题t职称t类型";PrintOne(p);}}voidInterface::Insert(){stringname;stringnumber;charsex;inty,m,d;stringspeciality;stringresearchTopic;stringacademi8、cTitle;inttype;charch='n';do{cout<<"你要输入的人员类型(1-学生2-研究生3-在职研究生4-教师):";cin>>type;while(type!=1&&type!=2&&type!=3&&type!=4){cout<<"输入错误,请重新输入";cout<<"你要输入的人员类型(1-学生2-研究生3-在职研究生4-教师):";cin>>type;}cout<<"姓名:";cin>>nam
5、>choi
6、ce;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=
7、pe.end()){if(p->GetNumber()==number)break;p++;}if(p==pe.end())cout<<"没有此人信息!";else{cout<<"姓名t编号t性别出生日期t专业t课题t职称t类型";PrintOne(p);}}voidInterface::Insert(){stringname;stringnumber;charsex;inty,m,d;stringspeciality;stringresearchTopic;stringacademi
8、cTitle;inttype;charch='n';do{cout<<"你要输入的人员类型(1-学生2-研究生3-在职研究生4-教师):";cin>>type;while(type!=1&&type!=2&&type!=3&&type!=4){cout<<"输入错误,请重新输入";cout<<"你要输入的人员类型(1-学生2-研究生3-在职研究生4-教师):";cin>>type;}cout<<"姓名:";cin>>nam
此文档下载收益归作者所有