2022年c语言课程设计职工信息管理系统 .pdf
《2022年c语言课程设计职工信息管理系统 .pdf》由会员分享,可在线阅读,更多相关《2022年c语言课程设计职工信息管理系统 .pdf(7页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、C 语言课程设计1.设计题目:职工信息管理系统2. 系统功能简介:系统以菜单方式工作1)职工信息录入(文件保存职工信息)2)输出职工信息、浏览职工信息3)查询职工信息4)根据员工号查找职工信息5)根据工资、年龄、性别对职工信息进行排序6)删除职工信息3. 设计实施:#include #include #include typedef struct Empk int EmpNum; /* staff number */ char EmpName12; /* name*/ int Sex; /*sex 1- woman 2- man*/ int Old; /* old*/ int Cult; /*
2、education background 1-specilist 2-doctor 3-others*/ int Salary; /*salary*/ char Address12; /* address*/ int Tell; /*telephone number*/ Emp; Emp emp100; void open() int i; 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 7 页 - - - - - - - - - FILE *fp; if(fp=fope
3、n(wyl,rb+)=NULL) printf(can not do it! Because of no file of informationn); exit(0); for(i=0;i100;i+) if(fread(&empi,sizeof(Emp),1,fp)=0) printf(Fail to outputn); exit(0); fclose(fp); void close() /*跳出 */ int i; FILE *fp; if(fp=fopen(wyl,wr+)=NULL) printf(can not do it!n); exit(0); for(i=0;i100;i+)
4、fwrite(&empi,sizeof(Emp),1,fp); fclose(fp); void inputEmpInfo() /* 输入信息 */ int i,k; for(i=0;i100;i+) printf(Please enter the staffs :nnumber:); scanf(%d,&empi.EmpNum); printf(nname:); scanf(%s,empi.EmpName); printf(nsex : 1- woman 2- man:); scanf(%d,&empi.Sex); printf(nold:); scanf(%d,&empi.Old); pr
5、intf(nEducation background:1-specialist 2-doctor 3-others); scanf(%d,&empi.Cult); printf(nsalary:); scanf(%d,&empi.Salary); printf(naddress:); scanf(%s,empi.Address); 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 7 页 - - - - - - - - - printf(ntellphone:); scan
6、f(%d,&empi.Tell); printf(continue?(1.yes 2.no); scanf(%d,&k); if(k=2) break; close(); void reorder() /* 修改 */ int i,s,j,k,l; Emp temp; open(); printf(nChoose which category would you want to usen1-sex n2-salary(from maximum to minimum) n3-old (from maximum to minimum) n ( enter the corresponding nem
7、ber) n); scanf(%d,&i); switch(i) case 1: printf(nchoose which sex do you want to inquire? 1-woman 2 -man ); scanf(%d,&s); for(j=0;empj.EmpNum!=0;j+) if(empj.Sex=s) printf( number:%dn,empj.EmpNum); printf(name:%s, empj.EmpName); printf(nsex 1- woman 2- man:%d, empj.Sex); printf(nold:%d, empj.Old); pr
8、intf(neducation background:%dttt 1-specialist 2-doctor 3-others ,empj.Cult); printf(nsalary:%d, empj.Salary); printf(naddress:%s, empj.Address); printf(ntelephone nember :%d, empj.Tell); break; case 2: for(k=0;empk.EmpNum!=0;j+ ) for(l=k;empl.EmpNum!=0;l+) 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - -
9、- - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 7 页 - - - - - - - - - if(empl.Salaryempl+1.Salary) temp=empl;empl=empl+1;empl+1=temp; printf( number:%dn,empk.EmpNum); printf(name:%s,empk.EmpName); printf(nsex 1- woman 2- man:%d,empk.Sex); printf(nold:%d,empk.Old); printf(neducation background:%dttt 1-spe
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年c语言课程设计职工信息管理系统 2022 语言 课程设计 职工 信息管理 系统
限制150内