ImageVerifierCode 换一换
格式:DOCX , 页数:24 ,大小:134.24KB ,
资源ID:8536084      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8536084.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(c++学校人员信息管理系统.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

c++学校人员信息管理系统.docx

1、c+学校人员信息管理系统1.C+课程设计题目:学校人员信息管理系统用c+设计一个大学教师和学生管理程序,教师包括编号(a),(c),职称(d)和教研室数据(b)的数据输入输出; 大学生包括编号(m),( s),性别(t),班号(n),英语(e),高等数学(f)和数据结构(g)三门课程成绩输入输出和计算机平均分(ave);研究生包括编号,性别,班号,指导教师和研究方法数据输入输出; 博士后数据的输入输出;博士后既是教师也是研究生.(用派生,继承的方法可以做)2.功能如下图所示: 3.部分代码#include#include#includepersons.h#includestudent.h#in

2、cludeteacher.h#includeempoyee.h#includechainList.h#includevoid fileRead(chainList *list,ifstream &ff);/把文件从硬盘上读入内存void fileWrite(chainList *list,ofstream &ff);/写入硬盘int compareStr(char*str1,char*str2);/名字作为关键字,这个函数就用来比较void addList(chainList *list);/同名的话,覆盖,或者改为新名字加入void deleteNode(chainList *node);/

3、根据名字删除void editList(chainList *list,char *name);/要编辑的人名和新的资料chainList *searchList(chainList *list,char*name);/只提供名字查询(其他以后加入)/返回前一个节点的指针void orderList(chainList *list);/按名字排序void orderListByAge(chainList *list);/按年龄降序排列void orderListBySex(chainList *list);/按照性别排列,女士优先void printStaticInfo(chainList*l

4、ist);void printList(chainList *list);int main()couttYou are welcome to the management system!endl; coutDo you want to load a file or setup a new list?Press l or s.sn; char fileName30; chainList headNode(0,NULL); chainList *head=&headNode; if(sn=l) ifstream file; coutFiles name:fileName; file.open(fi

5、leName); if(! file)/为何输入不存在地文件后,机子变得很慢,而且没有结果出来? coutFile not found!System exit.endl; return 1; / couttestendl;/竟然通过!file的检查?(文件不存在阿) fileRead(head,file);/读入文件到链表 file.close(); printStaticInfo(head); char ctn; do coutmain menu:endl; coutt1.Add a person. 2.Delete a person 3.Edit a personendl; coutt4.

6、Search a person 5.Order the list 6.Print info about the listendl; coutt0.exitctn; switch(ctn) case 0:break; case 1: addList(head); break; case 2: coutPlease input the persons name to be deleted:nm; chainList *pdel; pdel=searchList(head,nm); char sure;/Make sure whether you want to delete the data su

7、re=n; if(!pdel-next) coutThe person you input cannt be foundendl; else coutThe persons infor follows:next-pl-print(); coutAre you sure to delete it?Press y or nsure; if(sure=y) deleteNode(pdel); coutnm have been deleted!endl; break; case 3: coutPlease input the persons name:nm1; chainList *pp; pp=se

8、archList(head,nm1); if(pp-next) coutThe persons infor follows:next-pl-print(); coutNow ,please edit the infors.endl; editList(head,nm1); else coutThe person cant be found !endl; break; case 4: coutPlease input the persons name:name; chainList *p; p=searchList(head,name); if(p-next) p-next-pl-print()

9、; else coutThe person cant be found!endl; break; case 5: coutYou want to order the list by:endl; cout1.name 2.age 3.sex(lady first)ch; switch(ch) case 1: coutYou choose to order the list by name.The result are as follows:endl; orderList(head); printStaticInfo(head); break; case 2: coutYou choose to

10、order the list by age.The result are as follows:endl; orderListByAge(head); printStaticInfo(head); break; case 3: coutYou choose to order the list by sex.The result are as follows:endl; orderListBySex(head); printStaticInfo(head); break; default: coutWrong choice!endl; break; case 6: printStaticInfo

11、(head); break; default: coutWrong choice!endl; while(ctn!=0); coutDo you want to save the file?No,press n.Else,any other key.save; if(save!=n) coutPlease input the files name:fileName; ofstream fin; fin.open(fileName);/如果文件已经存在,询问是否覆盖。如何知道是否存在 if(!fin) coutCant open output file.n; return 1; fileWrit

12、e(head,fin); fin.close(); coutFile has been successfully saved!endl; coutByebye!tp; while(tp) ffag; ffnm; ffsx; switch(tp) case 1: ffgrd; ffschl; psn=new student(ag,nm,sx,grd,schl,e,m,g,average); break; case 2: ffsb; ffteaYear; psn=new teacher(ag,nm,sx,sb,teaYear); break; case 3: ffslr; psn=new empo

13、yee(ag,nm,sx,slr); break; chainList*s=new chainList(tp,psn); p-next=s; p=s; fftp; void fileWrite(chainList *list,ofstream &ff) chainList*p=list-next; while(p) fftypeOfPn pl-age pl-name pl-sextypeOfPn) case 1: ffpl)-grade pl)-schoolendl; break; case 2: ffpl)-subject pl)-yearsOfTendl; break; case 3: f

14、fpl)-salarynext; int aa=0; ffp2i) return 1; else return -1; void addList(chainList *list)/添加节点 char tp; int type; do coutThe person whose info you want to input is:endl; cout1.a student 2.a teacher 3.a common employeeendl; cout0.Return to main menu.tp;/为什么一输入字符就死循环? char nm20; int ag; char sx; int s

15、lr; int grd; char schl20; int e; int m; int g; int average; char sb20; int teaYear; int aa=1; persons*psn;/插入人员指针 switch(tp) case 0:aa=0; type=0; break; case 1: type=1; coutname:nm; coutage:ag; coutmale or female?m or f?sx; coutThe students gradegrd; coutFrom which school:schl; coutthe score of engl

16、ish:e; coutthe score of math:m; coutthe score of sjjg:g; coutaverage:averageendl; psn=new student(ag,nm,sx,grd,schl,e,m,g,average); break; case 2:type=2; coutname:nm; coutage:ag; coutmale or female?m or f?sx; coutsubject field:sb; coutYears as a teacher:teaYear; psn=new teacher(ag,nm,sx,sb,teaYear);

17、 break; case 3:type=3; coutname:nm; coutage:ag; coutmale or female?m or f?sx; coutThe employees salary:slr; psn=new empoyee(ag,nm,sx,slr); break; default:type=6; aa=0; coutWrong choice!next) =compareStr(nm,p-next-pl-name); coutnext&0)/比p节点小或者p为空退出 p=p-next; if(p-next) =compareStr(nm,p-next-pl-name);

18、 chainList *s=new chainList(type,psn); s-next=p-next; p-next=s; while(type); void deleteNode(chainList *node) chainList*ptemp=node-next; node-next=ptemp-next; delete ptemp;void editList(chainList *list,char *name)/删除,添加就是编辑。缺点:不想删除的也被删除了。 chainList *pde; pde=searchList(list,name); char tp; int type;

19、 do coutThe person whose info you want to input is:endl; cout1.a student 2.a teacher 3.a common employeeendl; cout0.Return to main menu.tp;/为什么一输入字符就死循环? char nm20; int ag; char sx; int slr; int grd; char schl20; int e; int m; int g; int average; char sb20; int teaYear; int aa=1; persons*psn;/插入人员指针

20、 if(tp=1|tp=2|tp=3) deleteNode(pde); switch(tp) case 0:aa=0; type=0; break; case 1: type=1; coutname:nm; coutage:ag; coutmale or female?m or f?sx; coutThe students gradegrd; coutFrom which school:schl; coutthe score of english:e; coutthe score of math:m; coutthe score of sjjg:g; psn=new student(ag,n

21、m,sx,grd,schl,e,m,g,average); break; case 2:type=2; coutname:nm; coutage:ag; coutmale or female?m or f?sx; coutsubject field:sb; coutYears as a teacher:teaYear; psn=new teacher(ag,nm,sx,sb,teaYear); break; case 3:type=3; coutname:nm; coutage:ag; coutmale or female?m or f?sx; coutThe employees salary:slr; psn=new empoyee(ag,nm,sx,slr); break; default:type=6; aa=0; coutWrong choice!next) =comp

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1