欢迎来到天天文库
浏览记录
ID:61419075
大小:29.00 KB
页数:9页
时间:2021-01-28
《C++程序设计——学生信息管理系统.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
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,stringsp,stringre,stringac,intt
2、y){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、returnsex;}DatePerson::GetBirth(){returnbirthday;}stringPerson::GetSpec(){returnspeciality;}stringPerson::GetResearch(){returnresearchTopic;}stringPerson::GetAcademic(){returnacademicTitle;}intPerson::GetType(){returntype;}#include"example9_05_interface.h"#include#include4、nip>#include#includeusingnamespacestd;Interface::Interface(){ReadFile();}voidInterface::Display(){cout<5、;cout<<"**********4.显示信息**********"<>choice;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(6、){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=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;char7、sex;inty,m,d;stringspeciality;stringresearchTopic;stringacademicTitle;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、returnsex;}DatePerson::GetBirth(){returnbirthday;}stringPerson::GetSpec(){returnspeciality;}stringPerson::GetResearch(){returnresearchTopic;}stringPerson::GetAcademic(){returnacademicTitle;}intPerson::GetType(){returntype;}#include"example9_05_interface.h"#include#include4、nip>#include#includeusingnamespacestd;Interface::Interface(){ReadFile();}voidInterface::Display(){cout<5、;cout<<"**********4.显示信息**********"<>choice;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(6、){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=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;char7、sex;inty,m,d;stringspeciality;stringresearchTopic;stringacademicTitle;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
4、nip>#include#includeusingnamespacestd;Interface::Interface(){ReadFile();}voidInterface::Display(){cout<5、;cout<<"**********4.显示信息**********"<>choice;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(6、){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=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;char7、sex;inty,m,d;stringspeciality;stringresearchTopic;stringacademicTitle;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、;cout<<"**********4.显示信息**********"<>choice;switch(choice){case0:break;case1:Insert();break;case2:Search();break;case3:Delete();break;case4:Output();break;}}while(choice);Save();}voidInterface::Search(
6、){stringnumber;cout<<"请输入要查询的编号:"<>number;set::iteratorp=pe.begin();while(p!=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;char
7、sex;inty,m,d;stringspeciality;stringresearchTopic;stringacademicTitle;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
此文档下载收益归作者所有