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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

C语言课设之人事管理系统.docx

1、C语言课设之人事管理系统C语言课程设计人事管理系统 题目要求:人事管理管理系统要求某高校主要人员有:在职人员(行政人员、教师、一般员工)、退休人员与临时工。现在,需要存储这些人员的人事档案信息:编号、姓名、性别、年龄、职务、职称、政治面貌、最高学历、任职时间、来院时间、人员类别。其中,人员编号唯一,不能重复。(1) 添加删除功能:能根据学院人事的变动情况,添加删除记录;(2) 查询功能:能根据编号与姓名进行查询;(3) 编辑功能(高级):根据查询对相应的记录进行修改,并存储;(4) 统计功能:能根据多种参数进行人员的统计(在职人数、党员人数、女工人数、高学历高职称人数(硕士学位以上或者副教授以

2、上),统计要求同时显示被统计者的信息;(5) 排序功能:按照年龄、来院时间进行排序;(6) 保存功能:能对输入的数据进行相应的存储;一、 需求分析:根据题目要求,职工信息就是存放在文件中的,所以应该提供相应的文件的输入输出的功能,在程序中应该有添加删除,查询,编辑,统计,排序,保存等程序实现相应的操作,另外菜单式的选择方式选择程序的功能也就是必须需的。另外程序中要求存储的模块,采用的方式均为将原文件中的所有数据读入内存,在内存中处理之后以覆盖的方式写入文件存贮,这样的方法在一定程度上提高了对数据处理的灵活性,较容易理解,但存在处理中遇到以外情况而丢失数据的风险,另外当文件中的数据量很大时,这种

3、方法也存在一定的难度,在本程序中将N定为100,基本上能满足要求;二、 总体设计:根据以上需求分析,将程序分成以下几个模块:1、 新建数据文件(build new data);2、 添加记录(add data);3、 删除记录(delete data);4、 按工号搜索(search by number);5、 按姓名搜索(search by name);6、 浏览全部数据(browse all);7、 修改数据(modify the data);8、 排序功能(order the volume);9、 统计功能(data a volume);系统功能模块图如下:三、 详细设计;1、 主函数:

4、1需求分析:为使系统执行完每部分功能后能够方便的回到系统主界面,main()函数设计的较简单,只包含一个menu()函数,其余的全部功能都通过menu()函数调用来实现,并通过menu()函数的递归调用实现返回主界面的功能。main()函数定义如下:main() menu();而menu()定义如下:2流程图:menu() int n,w1;doprintf(nttttMENUn);printf(tt0tbuild new datann);printf(tt1tdelete datann);printf(tt2tadd datann);printf(tt3tsearch by numbernn

5、);printf(tt4tsearch by namenn);printf(tt5tbrowse allnn);printf(tt6tmodify the datann);printf(tt7torder the volumenn);printf(tt8tdata a volumenn);printf(tt9texitnn);printf(tplease choice and enter a number bb);scanf(%d,&n);if(n8)w1=1; getchar(); else w1=0;while(w1=1);switch(n)case 0:build();break; /*

6、调用新建数据文件函数*/case 1:del();break; /*调用删除数据函数*/case 2:add();break; /*调用添加数据函数*/case 3:snum();break; /*调用按工号搜索函数*/case 4:sname();break; /*调用按姓名搜索函数*/case 5:browse();break; /*调用浏览数据函数*/case 6:modify();break; /*调用修改数据函数*/case 7:order();break; /*调用排序函数函数*/case 8:data();break; /*调用统计函数*/case 9:exit(0); /*退出

7、*/default:printf(input error! please input a number between 0 and 8);menu();2、各功能模块设计:(1)、新建数据文件模块:、数据结构;瞧各个数据信息,编号、姓名、性别、年龄、职务、职称、政治面貌、最高学历、任职时间、来院时间、人员类别,均为字符串类型,在文件中以文本形式存放,每条记录对应一个人员的信息,可以方便信息的管理;而数据读进内存中时,可以以结构体的形式,每一个结构体包含了一个人员的全部信息,多的人员的信息组成了一个结构体数组。定义如下:struct worker char num11; char name10;

8、 char sex2; char age3; char zhiwu15; char zhicheng15; char zhengzhi15; char xueli15; char renzhisj8; char laiyansj8; char leibie15; wkN,s;其中N就是宏定义形式定义的字符,临时定义为100,wkN,为存放人员信息的结构体数组,而S为临时的结构体,用来保存信息处理过程中的临时数据。2、流程图如下:3、程序:build() int i,m,k,p;FILE *fp;if(fp=fopen(worker00、txt,w)=NULL)printf(can not bu

9、ild filen);printf_back();printf(how many workers do you want to input(0-%d)?:,N);scanf(%d,&m);k=m;for(i=0;ik;i+)printf(nInput %dth worker record、n,i+1);input(i);for(p=0;p=i;p+)if(fprintf(fp,%st%st%1st%st%st%st%st%st%st%st%sn,wkp、num,wkp、name,wkp、sex,wkp、age,wkp、zhiwu,wkp、 zhicheng,wkp、zhengzhi,wkp、x

10、ueli,wkp、renzhisj,wkp、laiyansj,wkp、leibie)!=1)printf(cannot write the datann);fclose(fp);printf_back();(2)、追加模块:1需求分析该模块的功能就是拥护需要增加新的员工记录,从键盘输入并逐条写入到原来的文件中去,其中输入号码就是要防止号码重复,重复时报告错误,重新输入。为方便用户管理与查瞧,该模块采用的方式就是用先把原来文件中的数据读入内存,保存在内存中,然后在内存中的数据后面增加新的数据,操作完成后用写的方式打开文件,用覆盖的方式写入。2流程图:3程序:add() int i,m,n,k,p

11、;FILE *fp;n=load();if(n=-1)menu();printf(how many workers do you want to add(0-%d)?: bbb,N-n);scanf(%d,&m);k=m+n;for(i=n+1;i=k;i+)printf(nInput %dth worker record、n,i-n+1);input(i);if(fp=fopen(worker00、txt,w)=NULL) /*将数据保存到文件*/printf(can not open filen); printf_back();for(p=0;pk;p+)fprintf(fp,%st%st

12、%1st%st%st%st%st%st%st%st%sn,wkp、num,wkp、name,wkp、sex,wkp、age,wkp、zhiwu,wkp、 zhicheng,wkp、zhengzhi,wkp、xueli,wkp、renzhisj,wkp、laiyansj,wkp、leibie);fclose(fp);printf_back();(3)修改模块:1 需求分析:该模块的功能就是显示所有信息,考虑到记录较多,采用分屏显示,显示完所有的记录后,由用户输入需要修改的人员的号码,查找成功后,显示查找结果,并询问拥护修改人员的哪部分记录,根据用户选择修改相应的信息,然后保存修改后的结果;2 流

13、程图3 程序;modify() int i,n,k,p,w0=1,w1,w2=0;FILE *fp;n=load();dok=-1;printf_face();for(i=0;i=n;i+) if(i!=0)&(i%10=0) printf(nnRemember the No、which need modify、npress any key to continue、);getch();puts(nn); printf_one(i);doprintf(nnEnter NO、 that you want to modify!nttNO、 bb);scanf(%s,s、num);for(i=0;in

14、;i+) if(strcmp(s、num,wki、num)=0); k=i; s=wki; if(k=-1) printf(nnNO exit ! please again); while(k=-1);printf_face();printf_one(k);w1=modify_data(k); if(w1=1) printf(nsuccessful!nnDo yuo want to modify another?nntt1tYesnntt2tBack with savent bb); scanf(%d,&w0); w2=1; else w0=0; if(w2=1) wkk=s; wkk=s;

15、if(w0!=1&w2=1) fp=fopen(worker00、txt,w); for(p=0;pnntt1tNO、ntt2tnamentt3tsexntt4tagentt5tzhiwuntt6tzhichengntt7tzhengzhimianmaontt8txuelintt9trenzhishijianntt10tlaiyuanshijianntt11trenyuanleibiennttt bb);scanf(%d,&c);if(c11|c11|c1);doswitch(c)case 1:printf(the old number is %s,wki、num);input_num(i,i

16、-1);break;case 2:printf(the old name is %s,enter the new name:,wki、name);scanf(%s,wki、name);break;case 3:printf(the old sex is %s,enter the new sex:,wki、sex);scanf(%1s,wki、sex);break;case 4:printf(the old age is %s,enter the new age:,wki、age);scanf(%s,wki、age);break;case 5:printf(the old zhiwu is %s

17、,enter the new zhiwu:,wki、zhiwu);scanf(%s,wki、zhiwu);break;case 6:printf(the old zhicheng is %s,enter the new zhicheng:,wki、zhicheng);scanf(%s,wki、zhicheng);break;case 7:printf(the old zhengzhimianmao is %s,enter the new zhengzhimiainmao:,wki、zhengzhi);scanf(%s,wki、zhengzhi);break;case 8:printf(the

18、old zuigaoxueli is %s,enter the new zuigaoxueli:,wki、xueli);scanf(%s,wki、xueli);break;case 9:printf(the old renzhishijian is %s,enter the new renzhishijian:,wki、renzhisj);scanf(%s,wki、renzhisj);break;case 10:printf(the old laiyuanshijian is %s,enter the new laiyuanshijian:,wki、laiyansj);scanf(%s,wki

19、、laiyansj);break;case 11:printf(the old renyuanleibie is %s,enter the new renyuanleibie:,wki、leibie);scanf(%s,wki、leibie);break;printf(now:nn);printf_face();printf_one(i);printf(nare you sure?nntt1tsurentt2tNo and remodifyntt3tback without save in this timenttt bbb);scanf(%d,&w1);while(w1=2);return(

20、w1);(4)删除模块:1需求分析:该模块的运行方式与修改模块类似,首先分屏显示所有人员的记录,显示完所有的记录后,由用户输入要删除的人员的号码,根据号码查找相应的记录并将结果显示出来,经用户确认后删除,删除的方法就是将文件中的数据读入内存,赋给相应的结构体,并将结构体数组中将删除的后面的数据赋给前一个结构体,然后将相应数据写入文件并保存;2流程图:Y3程序;del() char c;int i,j,n,k,m,w0=1,w1=0,w2=0;FILE *fpt;n=load();dok=-1;printf_face();for(i=0;i=n;i+) if(i!=0)&(i%10=0) pri

21、ntf(nnRemember the No、which need delete、npress any key to continue、);getch();printf(nn); printf_one(i);do printf(nnEnter NO、 that you want to delete!nttNO、 bb);scanf(%s,s、num);for(i=0;i=n;i+) if(strcmp(s、num,wki、num)=0); k=i; s=wki; if(k=-1) printf(nnNO exit ! please again); while(k=-1);printf_face(

22、);printf_one(k);printf(are you sure to delete the data? ty/nntt bb); scanf(%1s,&c); if(c=y) for(j=i;j=n;j+) wkj=wkj+1; w1=1; else menu(); if(w1=1) printf(nsuccessful!nnDo yuo want to delete another?nntt1tYesnntt2tBack with saventbb); scanf(%d,&w0); w2=1; if(w0!=1&w2=1) fpt=fopen(worker00、txt,w); for

23、(m=0;mn;m+)fprintf(fpt,%st%st%1st%st%st%st%st%st%st%st%sn,wkm、num,wkm、name,wkm、sex,wkm、age,wkm、zhiwu,wkm、 zhicheng,wkm、zhengzhi,wkm、xueli,wkm、renzhisj,wkm、laiyansj,wkm、leibie);fclose(fpt); while(w0=1);menu();(5)、按号码搜索:1需求分析:该模块的功能就是按照输入的人员的号码查找对应的记录,并将其显示,查找成功以后,增加删除与修改等功能,其中删除与修改功能可以通过调用相应的函数来实现。2流

24、程图;3、程序;snum() FILE *fp;int i,n,k,p,w1=1,w2,w3,w4;n=load();do do k=-1; printf(nnEnter the number that you want to search!nttnumber: bbbbb); scanf(%s,s、num);for(i=0;i=n;i+)if(strcmp(s、num,wki、num)=0) k=i; printf_one(k);break; if(k=-1) printf(nnNO exist!please);printf(nnAre you again?ntt1tagainntt2tNO

25、 and backntt bb);scanf(%d,&w1);if(w1=1)snum();break;if(w1=2) menu();break; while(k=-1&w1=1);w4=0;w3=0;if(k!=-1); printf(nnWhat do you want to do ?ntt1tsearch anotherntt2tmodifyntt3tDeletentt4tback menuntt bb); scanf(%d,&w2); switch(w2) case 1:snum();break;case 2:w3=modify_data(k);break;/*调用修改数据函数*/case 3:printf(nAre you sure?ntt1tsurentt2tno and backntt bb); scanf(%d,&w4); if(w4=1) for(p=i;p=n;p+) wkp=wkp+1; break;case 4:menu();break; if(w3=1|w4=1) fp=fopen(worker00、txt,w);for(p=0;p=n;p+)fprintf(fp,%st%st%1st%st%st%st%st%st%st%st%sn,wkp、num,wkp、name,wkp、sex,wkp、age,wkp、zhiwu,wk

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

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