高校人事管理系统课程设计C++版.doc

上传人:豆**** 文档编号:29948827 上传时间:2022-08-02 格式:DOC 页数:112 大小:217KB
返回 下载 相关 举报
高校人事管理系统课程设计C++版.doc_第1页
第1页 / 共112页
高校人事管理系统课程设计C++版.doc_第2页
第2页 / 共112页
点击查看更多>>
资源描述

《高校人事管理系统课程设计C++版.doc》由会员分享,可在线阅读,更多相关《高校人事管理系统课程设计C++版.doc(112页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-date高校人事管理系统课程设计C+版高校人事管理系统课程设计C+版一 需求分析1. 目的与意义、2. 系统流程图高校人事管理系统删除人员信息增加人员资料选择要进行的操作1 2 查询人员信息修改人员信息 3 4 数据存盘数据装入 56退出显示所有信息 8 7 二 总体设计1. 系统功能分析 执行程序后,按界面的显示,选择18种操作。选1,增加人员资料,资料包括编号、职工类别、

2、姓名、性别、年龄、来院时间、职务、职称、党派、学历。选2,删除人员信息。选3,修改人员信息,可以选择要修改的内容。选4,查询人员信息,可按编号或姓名查询。选5,数据存盘。选6,数据装入。选7,显示所有信息。选8,退出。2. 系统功能模块划分与设计高校人事管理系统 修改功能删除功能添加功能查询功能数据存盘与装入功能显示功能 三 详细设计1. 源程序代码#include#include#include#includeclass personprivate: int no;/编号 char type20;/职工类型 char name20;/姓名 char sex10;/性别 int age;/年龄

3、 char time20;/来院时间 char pos20;/职务 char techpos20;/职称 char party20;/党派 char study30;/最高学历person *mynext;/指针语public:person(int nnum,char ntype,char nname,char nsex,int nage,char ntime,char npos,char ntechpos,char nparty,char nstudy)no=nnum;strcpy(type,ntype);/将ntype的值复制给typestrcpy(name,nname); strcpy(

4、sex,nsex); age=nage; strcpy(time,ntime); strcpy(pos,npos); strcpy(techpos,ntechpos); strcpy(party,nparty); strcpy(study,nstudy); mynext=NULL;person(int nnum,char ntype,char nname,char nsex,int nage,char ntime,char npos,char ntechpos,char nparty,char nstudy,person *next) /某高校,主要人员有:在职人员(行政人员、教师、一般员工)

5、、退休人员、返聘人员和临时工。 /现在,需要存储这些人员的人事档案信息:编号、姓名、性别、年龄、职务、职称、政治面貌、最高学历、来院时间。no=nnum; strcpy(type,ntype); strcpy(name,nname); strcpy(sex,nsex); age=nage; strcpy(time,ntime); strcpy(pos,npos); strcpy(techpos,ntechpos); strcpy(party,nparty); strcpy(study,nstudy); mynext=next;void setnext(person *next)mynext=n

6、ext;person *getnext()return mynext;int getnum()return no;char *getname()return name;char *getsex()return sex;char *getpos()return pos;char *gettechpos()return techpos;char *gettime()return time;char *getparty()return party;char *getstudy()return study;int getage()return age;void getag(int as)age=as;

7、char *gettype()return type;class Schoolprivate:person *myfirst;int firstnum;public:School()/无参构造函数myfirst=NULL;/将指针置空School(int nnu,char ntyp,char nnam,char nse,int nag,char ntim,char npo,char ntechpo,char npart,char nstud)/有参构造函数myfirst=new person(nnu,ntyp,nnam,nse,nag,ntim,npo,ntechpo,npart,nstud)

8、;/在信息最后添加新的信息 void insertatlast(int nnum,char ntype,char nname,char nsex,int nage,char ntime,char npos,char ntechpos,char nparty,char nstudy)person *next=myfirst;/定义对象指针并付初值if(next=NULL)myfirst=new person(nnum,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy);elsewhile(next-getnext()!=NULL)ne

9、xt=next-getnext();next-setnext(new person(nnum,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy,next-getnext();void printf(int r)/获取信息int nage;char ntype20,nname20,nsex20,ntime20,npos20,ntechpos20,nparty20,nstudy20;cout请输入编号为r的成员的信息endl; cout输入职工分类码行政人员,教师,一般员工,退休人员,返聘人员,临时工:ntype; cout输入姓名:n

10、name; cout输入性别:nsex; cout输入年龄:nage; cout输入来院时间:ntime; cout输入职务无,科级,处级,地级:npos; cout输入职称无,初级,中级,高级:ntechpos; cout输入加入党派群众,中共党员,民主党派:nparty; cout输入学历小学,初中,高中,大专,大学,硕士,博士:nstudy;insertatlast(r,ntype,nname,nsex,nage,ntime,npos,ntechpos,nparty,nstudy);void printf1(person *ahead)/输出信息cout编号:setiosflags(io

11、s:left)setw(26)getnum()姓名:getname()endl;cout性别:setiosflags(ios:left)setw(26)getsex()年龄:getage()endl;cout职工类型:setiosflags(ios:left)setw(22)gettype()职务:getpos()endl; cout职称:setiosflags(ios:left)setw(26)gettechpos()学历:getstudy()endl; cout政治面貌:setiosflags(ios:left)setw(22)getparty()来院时间:gettime()endl;vo

12、id printf()person *ahead=myfirst;cout编号-姓名-性别-年龄-职工类型-职务-职称-学历-政治面貌-来院时间nendl;while(ahead!=NULL) coutsetiosflags(ios:left)setw(4)getnum()setiosflags(ios:left)setw(6)getname() ; coutsetiosflags(ios:left)setw(5)getsex()setiosflags(ios:left)setw(4)getage() ;coutsetiosflags(ios:left)setw(10)gettype()set

13、iosflags(ios:left)setw(6)getpos() ; coutsetiosflags(ios:left)setw(6)gettechpos()setiosflags(ios:left)setw(6)getstudy();coutsetiosflags(ios:left)setw(9)getparty()setiosflags(ios:left)setw(12)gettime()getnext();void add()/添加新信息int i,a,b;person *p1=myfirst;if(p1=NULL)couti; printf(i);elseif(p1-getnext(

14、)=NULL)/如果p1的后继指针为空,则执行“printf(a)”a=p1-getnum()+1;printf(a);elsewhile(p1-getnext()!=NULL)/p1的后继指针不为空,则执行“printf(b)”p1=p1-getnext();b=p1-getnum()+1;printf(b);bool removedatnum( )/删除信息int bh; person *ahead=myfirst; person *follow=ahead; coutbh;if(ahead=NULL)return false;elseif(ahead-getnum()=bh)myfirs

15、t=myfirst-getnext();cout编号为bh的成员以被删除getnext();while(ahead!=NULL)if(ahead-getnum()=bh)follow-setnext(ahead-getnext();cout编号为bhgetnext();cout要删除的成员不存在!endl;return false;bool find1()/按编号查找int id; person *ahead=myfirst; person *follow=ahead; cout请输入编号:id; cout*endl;if(ahead=NULL)cout无人员信息!getnum()=id)pr

16、intf1(ahead);return true;elsefollow=ahead;ahead=ahead-getnext();cout无此人信息:endl;return false;bool find2( )/按姓名查找char nm20; person *ahead=myfirst; person *follow=ahead; coutnm; cout*endl;if(ahead=NULL)cout无人员信息getname(),nm)=0)printf1(ahead);return true;elsefollow=ahead;ahead=ahead-getnext();cout查无此人:e

17、ndl;return false;bool upperson()/修改信息int iid; person *ahead=myfirst; person *follow=ahead; coutiid;if(ahead=NULL)cout无人员信息getnum()=iid)printf1(ahead);int nu=-1;for(int i=1;nu!=0;i+)int ml; int mll; char ty30;cout请选择要修改的内容:endl; cout 1:姓名2:性别3:年龄4:职工类型 5:职务endl; cout6:职称 7:学历 8:政治面貌 9:来院时间endl; coutm

18、l;switch(ml)case 1: coutty; strcpy(follow-getname(),ty); ;break;case 2:coutty; strcpy(ahead-getsex(),ty);break;case 3:coutmll; ahead-getag(mll);break;case 4:coutty; strcpy(ahead-gettype(),ty); break;case 5:coutty; strcpy(ahead-getpos(),ty);break;case 6:coutty;strcpy(ahead-gettechpos(),ty);break;case

19、 7:coutty;strcpy(ahead-getstudy(),ty);break;case 8:coutty;strcpy(ahead-getparty(),ty);break;case 9:coutty;strcpy(ahead-gettime(),ty);break; return true;elseahead=ahead-getnext();follow=ahead;cout没有此人nnumntypennamensexnagentimenposntechposnpartynstudy; insertatlast(nnum,ntype,nname,nsex,nage,ntime,np

20、os,ntechpos,nparty,nstudy);fperson.close();coutn人员和相关数据已经装入.n;void save()/保存文件到文件中ofstream fperson;fperson.open(person.txt,ios:out);person *p=myfirst;while(p)fpersongetnum()tgettype()tgetname()tgetsex()tgetage()tgettime()tgetpos()tgettechpos()tgetparty()tgetstudy();fpersongetnext();fperson.close();c

21、out保存数据已经完成getnext();delete temp;myfirst=NULL;void main()School s;/定义对象int c;docout*endl;cout 高校人事管理系统 endl;cout endl;cout 1-增加人员资料 endl;cout 2-删除人员信息 endl;cout 3-修改人员信息 endl;cout 4-查询人员信息 endl;cout 5-数据存盘 endl;cout 6-数据装入 endl;cout 7-显示所有信息 endl;cout 8-退出 (1-8):endl;cout*c;switch(c)case 1:s.add();

22、break;case 2:s.removedatnum(); break;case 3:s.upperson(); break;case 4:int nm;coutnm;if(nm=1)s.find1();elses.find2(); ;break; case 5: s.save();break;case 6: s.load();break; case 7: s.printf();break;while(c!=8);2. 类层次图数据成员:int no, char type20, char name20, char sex10, int age, char time20, char pos20

23、, char techpos20, char party20, char study30 person *mynext函数: person(int nnum,char ntype,char nname,char nsex,int nage,char ntime,char npos,char ntechpos,char nparty,char nstudy)class personperson(int nnum,char ntype,char nname,charnsex,int nage,char ntime,char npos,char ntechpos,char nparty,charns

24、tudy,person *next)void setnext(person *next) person *getnext()int getnum() char *getname()char *getsex() char *getpos()char *gettechpos() char *gettime()char *getparty() char *getstudy()int getage() void getag(int as)char *gettype()数据成员:person *myfirst,int firstnum函数School() School(int nnu,char ntyp

25、,char nnam,char nse,intnag,char ntim,char npo,char ntechpo,char npart,char nstud)void insertatlast(int nnum,char ntype,charnname,char nsex,int nage,char ntime,char npos,char ntechpos,char nparty,char nstudy)class Schoolvoid printf(int r)void printf1(person *ahead)void printf()void add()bool removeda

26、tnum( )bool find1()bool find2( )bool upperson()void load()void save()School()四界面设计与各功能模块实现1.界面设计cout*endl;cout 高校人事管理系统 endl;cout endl;cout 1-增加人员资料 endl;cout 2-删除人员信息 endl;cout 3-修改人员信息 endl;cout 4-查询人员信息 endl;cout 5-数据存盘 endl;cout 6-数据装入 endl;cout 7-显示所有信息 endl;cout 8-退出 (1-8):endl;cout*endl;cout*endl;2.各功能模块实现添加功能void add()/添加新信息int i,a,b;person *p1=myfirst;if(p1=NULL)couti; printf(i);elseif(p1-

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 小学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com