您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 薪酬管理 > 企业职工工资管理系统_附代码(DOC32页)
#includestdio.h#includestring.h#includestdlib.h#defineE50voidCreat();voidCreat2();voidCreat3();voidChakan();voidChakan2();voidChakan3();voidadd();voiddel();voidxiugai();voidfindnum();voidfindname();voidfindname2();voidfindshijian();voidgengxin();voidfindtime();voidjisuan();voidjisuan2();voidjisuan3();voidpai();voidput();intnumber;floatsum;structemployee{charnum[5];charname[10];charsex[3];charshengri[10];chardegree[10];intnianxian;}emp[E];structemp_kao{charnum[5];charname[10];charriqi[10];inttianshu;}emp_kaoqin[E];structemp_gong{charnum[5];charname[10];floatzhiwugongzi,zhiwubutie,zhufangbutie,kaoqin,yingfagongzi,yanglaobaoxian,zhufang,shifagongzi;}emp_gongzi[E];voidmain(){charYN[3];char*Y=Y;char*N=N;inti;intLL;//put();printf(********企业职工工资管理系统********\n);kaishi:printf(\n创建文件(请选【1】)\n操作文件(请选【2】)\n查看文件(请选【3】)\n更新文件(请选【4】)\n);scanf(%d,&LL);if(LL==1){Creat();printf(\n创建考勤记录文件??Y/N(注意大写)\n);scanf(%s,&YN);if(strcmp(YN,Y)==0){Creat2();printf(\n创建工资信息文件??Y/N(注意大写)\n);scanf(%s,&YN);if(strcmp(YN,Y)==0){Creat3();gotokaishi;}else{gotokaishi;}}else{gotokaishi;}}elseif(LL==2){caozuo:printf(增加人事基本信息(请选【1】)\n);printf(删除人事基本信息(请选【2】)\n);printf(修改人事基本信息(请选【3】)\n);printf(查询人事基本信息(请选【4】)\n);printf(输出某月份的职工工资信息(请选【5】)\n);printf(职工工资信息进行统计(请选【6】)\n);printf(退出(请选【7】)\n);scanf(%d,&LL);if(LL==1){add();gotocaozuo;}elseif(LL==2){shanchu:del();printf(是否继续删除??(注意大写)\n);scanf(%s,&YN);if(strcmp(YN,Y)==0){gotoshanchu;}elseif(strcmp(YN,N)==0){gotocaozuo;}else{printf(操作错误!!返回-\n);gotocaozuo;}}elseif(LL==3){xiugai:xiugai();printf(是否继续修改??(注意大写)\n);scanf(%s,&YN);if(strcmp(YN,Y)==0){gotoxiugai;}elseif(strcmp(YN,N)==0){gotocaozuo;}else{printf(操作错误!!返回-\n);gotocaozuo;}}elseif(LL==4){chaxun:printf(编号查询(请选【1】)\n全名查询(请选【2】)\n姓查询(请选【3】)\n月份查询(请选【4】)\n退出(请选【5】)\n\n);scanf(%d,&LL);if(LL==1){findnum();gotochaxun;}if(LL==2){findname();gotochaxun;}if(LL==3){findname2();gotochaxun;}if(LL==4){findtime();gotochaxun;}if(LL==5){gotocaozuo;}else{printf(操作错误!!返回-\n);gotocaozuo;}}if(LL==5){findshijian();gotocaozuo;}if(LL==6){jisuan:printf(职工人数...(请选【1】)\n平均实发工资(请选【2】)\n低于平均工资(请选【3】)\n退出(请选【4】)\n);scanf(%d,&LL);if(LL==1){jisuan();gotojisuan;}elseif(LL==2){jisuan2();gotojisuan;}elseif(LL==3){jisuan3();gotojisuan;}elseif(LL==4){gotocaozuo;}else{printf(操作错误!!返回-\n);gotojisuan;}}if(LL==7){gotokaishi;}}elseif(LL==3){chakan:printf(\n查看基本信息文件(请选【1】)\n查看考勤记录文件(请选【2】)\n查看工资信息文件(请选【3】)\n退出(请选【4】)\n);scanf(%d,&LL);if(LL==1){Chakan();gotochakan;}elseif(LL==2){Chakan2();gotochakan;}elseif(LL==3){Chakan3();gotochakan;}elseif(LL==4){gotokaishi;}else{printf(操作错误!!返回-\n);gotochakan;}}elseif(LL==4){gengxin();gotokaishi;}intaa;scanf(%d,&aa);}voidCreat(){FILE*fp;inti,j;printf(创建【一】基本信息文件.....\n);printf(请您输入创建人数:);scanf(%d,&number);if((fp=fopen(number.dat,wb+))==NULL){printf(Can'topenfile\n);exit(0);}fwrite(&number,sizeof(int),1,fp);fclose(fp);if((fp=fopen(employee.dat,wb+))==NULL){printf(Can'topenfile\n);exit(0);}printf(编号姓名性别出生日期职称工作年限\n);for(i=0;inumber;i++){j=i+1;printf(-【%d】,j);scanf(%s%s%s%s%s%d,emp[i].num,emp[i].name,emp[i].sex,emp[i].shengri,emp[i].degree,&emp[i].nianxian);printf(\n);}pai();fwrite(emp,sizeof(structemployee),number,fp);fclose(fp);if((fp=fopen(employee.dat,rb+))==NULL){printf(Can'topenfile\n);exit(0);}printf(创建成功!!\n);printf(编号姓名性别出生日期职称工作年限\n);for(i=0;fread(&emp[i],sizeof(structemployee),1,fp)==1;i++){printf(%s%s%s%s%s%d\n,emp[i].num,emp[i].name,emp[i].sex,emp[i].shengri,emp[i].degree,emp[i].nianxian);}fclose(fp);}voidCreat2(){FILE*fp,*fp2;inti,j;printf(创建【二】考勤记录文件.....\n);printf(目前需创建人数:%d\n,number);printf(编号姓名日期出勤次数\n,number);if((fp=fopen(employee.dat,rb))==NULL){printf(Can'topenfile\n);exit(0);}fread(emp,sizeof(structemployee),number,fp);if((fp2=fopen(emp_kao.dat,wb))==NULL){printf(Can'topenfile\n);exit(0);}for(i=0;inumber;i++){j=i+1;strcpy(emp_kaoqin[i].name,emp[i].name);strcpy(emp_kaoqin[i].num,emp[i].num);printf(-【%d】%s%s,j,emp_kaoqin[i].num,emp_kaoqin[i].name);scanf(%s%d,emp_kaoqin[i].riqi,&emp_kaoqin[i].tianshu);printf(\n);}fwrite(emp_kaoqin,sizeof(structemp_kao),number,fp2);fclose(fp);fclose(fp2);if((fp=fopen(emp_kao.dat,rb+))==NULL){printf(Can'topenfile\n);exit(0);}printf(创建成功!!\n);printf(编号姓名日期出勤天数\n);for(i=0;fread(&emp_kaoqin[i],sizeof(structemp_kao),1,fp)==1;i++){printf(%s%s%s%d\n,emp_kaoqin[i].num,emp_kaoqin[i].name,emp_kaoqin[i].riqi,emp_kaoqin[i].tianshu);}fclose(fp);}voidCreat3(){FILE*fp,*fp2,*fp3;inti,j;char*zhugong=助工;char*gongchengshi=工程师;char*gaojigongchengshi=高级工程师;floatzhiwugongzi,zhiwubutie,zhufangbutie,kaoqin,yingfagongzi,yanglaobaoxian,zhufang,shifagongzi;printf(创建【三】工资信息文件.....\n);printf(共创建人数:%d\n,number);if((fp=fopen(employee.dat,rb))==NULL){printf(Can'topenfile\n);exit(0);}fread(emp,sizeof(structemployee),number,fp);if((fp2=fopen(emp_kao.dat,rb))==NULL){printf(Can'topenfile\n);exit(0);}fread(emp_kaoqin,sizeof(structemp_kao),number,fp2);if((fp3=fopen(emp_gong.dat,wb))==NULL){printf(Can'topenfile\n);exit(0);}for(i=0;inumber;i++){j=i+1;strcpy(emp_gongzi[i].name,emp[i].name);strcpy(emp_gongzi[i].num,emp[i].num);floatzhi
本文标题:企业职工工资管理系统_附代码(DOC32页)
链接地址:https://www.777doc.com/doc-1014414 .html