电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

c语言课程设计职工信息管理系统

c语言课程设计职工信息管理系统_第1页
1/7
c语言课程设计职工信息管理系统_第2页
2/7
c语言课程设计职工信息管理系统_第3页
3/7
C 语言课程设计 1 . 设计题目:职工信息管理系统 2 . 系统功能简介: 系统以菜单方式工作 1 )职工信息录入(文件保存职工信息) 2 )输出职工信息、浏览职工信息 3 )查询职工信息 4 )根据员工号查找职工信息 5 )根据工资、年龄、性别对职工信息进行排序 6 )删除职工信息 3 . 设计实施: #include #include #include typedef struct Empk { int EmpNum; /* staff number */ char EmpName[12]; /* name*/ int Sex; /*sex 1- woman 2- man*/ int Old; /* old*/ int Cult; /*education background 1-specilist 2-doctor 3-others*/ int Salary; /*salary*/ char Address[12]; /* address*/ int Tell; /*telephone number*/ }Emp; Emp emp[100]; void open() { int i; FILE *fp; if((fp=fopen("wyl","rb+"))==NULL) {printf("can not do it! Because of no file of information\n"); exit(0);} for(i=0;i<100;i++) {if(fread(&emp[i],sizeof(Emp),1,fp)==0) {printf("Fail to output\n"); 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;i<100;i++) fwrite(&emp[i],sizeof(Emp),1,fp); fclose(fp); } void inputEmpInfo() /*输入信息*/ { int i,k; for(i=0;i<100;i++) { printf("Please enter the staff's :\nnumber:"); scanf("%d",&emp[i].EmpNum); printf("\nname:"); scanf("%s",emp[i].EmpName); printf("\nsex : 1- woman 2- man:"); scanf("%d",&emp[i].Sex); printf("\nold:"); scanf("%d",&emp[i].Old); printf("\nEducation background:1-specialist 2-doctor 3-others"); scanf("%d",&emp[i].Cult); printf("\nsalary:"); scanf("%d",&emp[i].Salary); printf("\naddress:"); scanf("%s",emp[i].Address); printf("\ntellphone:"); scanf("%d",&emp[i].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 use\n1---sex \n2---salary(from...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

c语言课程设计职工信息管理系统

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部