1.C++课程设计题目:《学校人员信息管理系统》用c++设计一个大学教师和学生管理程序,教师包括编号(a),姓名(c),职称(d)和教研室数据(b)的数据输入输出; 大学生包括编号(m),姓名( s),性别(t),班号(n),英语(e),高等数学(f)和数据结构(g)三门课程成绩输入输出和计算机平均分(ave);研究生包括编号,姓名,性别,班号,指导教师和研究方法数据输入输出; 博士后数据的输入输出;博士后既是教师也是研究生.(用派生,继承的方法可以做)2.功能如下图所示:3.部分代码#include<iostream.h>#include<fstream.h>#include"persons.h"#include"student.h"#include"teacher.h"#include"empoyee.h"#include"chainList.h"#include<stdio.h>void 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);//根据名字删除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*list);void printList(chainList *list);int main(){cout<<"\tYou are welcome to the management system!"<<endl;cout<<"Do you want to load a file or setup a new list?Press l or s."<<endl;char sn;cin>>sn;char fileName[30];chainList headNode(0,NULL);chainList *head=&headNode;if(sn=='l'){ifstream file;cout<<"File's name:"<<endl;cin>>fileName;file.open(fileName);if(! file)//为何输入不存在地文件后,机子变得很慢,而且没有结果出来?{cout<<"File not found!System exit."<<endl;return 1;}// cout<<"test"<<endl;//竟然通过!file的检查?(文件不存在阿)fileRead(head,file);//读入文件到链表file.close();}printStaticInfo(head);char ctn;do{cout<<"main menu:"<<endl;cout<<"\t1.Add a person. 2.Delete a person 3.Edit a person"<<endl;cout<<"\t4.Search a person 5.Order the list 6.Print info about the list"<<endl;cout<<"\t0.exit"<<endl;cin>>ctn;switch(ctn){case '0':break;case '1':addList(head);break;case '2':cout<<"Please input the person's name to be deleted:"<<endl;char nm[20];cin>>nm;chainList *pdel;pdel=searchList(head,nm);char sure;//Make sure whether you want to delete the datasure='n';if(!pdel->next){cout<<"The person you input cann't be found"<<endl;}else{cout<<"The persons infor follows:"<<endl;pdel->next->pl->print();cout<<"Are you sure to delete it?Press y or n"<<endl;cin>>sure;if(sure=='y'){deleteNode(pdel);cout<<nm<<" have been deleted!"<<endl;}}break;case '3':cout<<"Please input the person's name:"<<endl;char nm1[20];cin>>nm1;chainList *pp;pp=searchList(head,nm1);if(pp->next){cout<<"The person's infor follows:"<<endl;pp->next->pl->print();cout<<"Now ,please edit the infors."<<endl;editList(head,nm1);}elsecout<<"The person can't be found !!"<<endl;break;case '4':cout<<"Please input the person's name:"<<endl;char name[30];cin>>name;chainList *p;p=searchList(head,name);if(p->next){p->next->pl->print();}elsecout<<"The person can't be found!"<<endl;break;case '5':cout<<"You want to order the list by:"<<endl;cout<<" 2.age 3.sex(lady first)"<<endl;char ch;cin>>ch;switch(ch){case '1':cout<<"You choose to order the list by name.The result are as follows:"<<endl;orderList(head);printStaticInfo(head);break;case '2':cout<<"You choose to order the list by age.The result are as follows:"<<endl;orderListByAge(head);printStaticInfo(head);break;case '3':cout<<"You choose to order the list by sex.The result are as follows:"<<endl;orderListBySex(head);printStaticInfo(head);break;default:cout<<"Wrong choice!"<<endl;}break;case '6':printStaticInfo(head);break;default:cout<<"Wrong choice!"<<endl;}}while(ctn!='0');cout<<"Do you want to save the file?No,press n.Else,any other key."<<endl;char save;cin>>save;if(save!='n'){cout<<"Please input the file's name:"<<endl;cin>>fileName;ofstream fin;fin.open(fileName);//如果文件已经存在,询问是否覆盖。