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

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
void addList(chainList *list);//同名的话,覆盖,或者改为新名字加入
void deleteNode(chainList *node);//根据名字删除
void editList(chainList *list,char *name);//要编辑的人名和新的资料
chainList *searchList(chainList *list,char*name);//只提供名字查询(其他以后加入)
editList(head,nm1);
}
else
//返回前一个节点的指针
void orderList(chainList *list);//按名字排序
void orderListByAge(chainList *list);//按年龄降序排列
void orderListBySex(chainList *list);//按照性别排列,女士优先
void printStaticInfo(chainList*list);
#include<stdio.h>
void fileRead(chainList *list,ifstream &ff);//把文件从硬盘上读入存
void fileWrite(chainList *list,ofstream &ff);//写入硬盘
int compareStr(char*str1,char*str2);//名字作为关键字,这个函数就用来比较
file.open(fileName);
if(! file)//为何输入不存在地文件后,机子变得很慢,而且没有结果出来?
{cout<<"File not found!System exit."<<endl;
return 1;
}
//cout<<"test"<<endl;//竟然通过!file的检查?(文件不存在阿)
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;
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 data
1.C++课程设计题目:《学校人员信息管理系统》
用c++设计一个大学教师和学生管理程序,教师包括编号(a),(c),职称(d)和教研室数据(b)的数据输入输出; 大学生包括编号(m),( s),性别(t),班号(n),英语(e),高等数学(f)和数据结构(g)三门课程成绩输入输出和计算机平均分(ave);研究生包括编号,,性别,班号,指导教师和研究方法数据输入输出; 博士后数据的输入输出;博士后既是教师也是研究生.(用派生,继承的方法可以做)
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;
fileRead(head,file);//读入文件到链表
file.close();
}
printStaticInfo(head);
char ctn;
do
{cout<<"main menu:"<<endl;
cout<<"\t1.Add a person. 2.Delete a person3.Edit a person"<<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];
2.功能如下图所示:
3.部分代码
#include<iostream.h>
#include<fstream.h>
#include"persons.h"
#include"student.h"
#include"teacher.h"
#include"empoyee.h"
#include"chainList.h"
sureቤተ መጻሕፍቲ ባይዱ'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;
cout<<"\t4.Search a person 5.Order the list6.Print info about the list"<<endl;
cout<<"\t0.exit"<<endl;
cin>>ctn;
switch(ctn)
{
case '0':break;
case '1':
addList(head);
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;
相关文档
最新文档