欢迎来到天天文库
浏览记录
ID:27779038
大小:120.50 KB
页数:12页
时间:2018-12-06
《c语言工资管理系统》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、C语言课程设计•工资管理系统题目要求做一个工资管理系统,要能按照姓名和卡号查找员工的工资信息,以及员工工资信息的插入,册餘。同时这些信息要存储在TXT文件中...还要可以按照一定顺序输出所有员工工资的信息#include#include#defineN100structmygz{intyuefen;floatyfgz;floatsf;floatdf;floatsj;floatsfgz;};structworker{intkahao;charxingming[201;
2、structmygzm[12];floatzsfgz;};intygsm;structworkera[N];floatshuijin(floatm){floatshuil,shui2;floattmp;shuil=0;shui2=0;if(m〉=1400){shuil=(m-1400)*0.1;shui2=30;}else{if(m>=800&&m<1400)shui2=(m-800)*0.05;}tmp=shuil+shui2;return(tmp);}floatshifagongzi(floata,
3、floatb,floatc,floatd){floate=a-b-c-d;return(e);}voidduqu(){FILE*fp;if((fp=fopen(nD:工资信息.txt","r"))==NULL){printf("无法读取文件");;return;}while(!feof(fp)){fread(&a[ygsm],sizeof(structworker),1,fp);ygsm++;}}voidchaxun(){intb;inti;intj;label_3:b=0;while(b!=l&&b!
4、=2){printf("l,选择姓名查询An2,选择卡号查询An");scanf("%d",&b);}if(b==l){charc[20];printf("请输入您的姓名An");scanf(”%s",c);i=0;while(!(strcmp(a[il.xingming,c)==O)&&i5、ingming);for(j=0;a[i].m[j].yuefen!=NULL;j++){printf("月份:%5d,应发工资:。/ol0.2f,水费:%7.2f,电费:%7.2f,税金:%7.2f,实发工^:%10.2f.,f,a[i].m[j].yuefen,a[i]mrjl-yfgz,a[i].mrj].sf,afi]-mrj]-dfXil-mrj]sj,a[i]-nirj].sfgz);}printf("总实发工资:。/olOf",a[i].zsfgz);b=0;while(b!=l&6、&b!=2){printf("l,继续査询An2,返回主菜单An");scanf("%d",&b);}if(b==l)igotolabel_3;}else{;return;}}else{intd=0;while(!(d〉=10001&&d<=32767)){printf("请输入您的卡号(五位数字),例如:10001H);scanf("%d",&d);}i=0;while(a[i].kahao!=d&&i7、字或川卡号查询n);return;}printf("%-10d%-20s",d,a[i].xingming);for(j=0;a[i].m[j].yuefen!=NULL;j++){printf("月份:%5d,应发工资:%10.2f,水费:%7.2f,电费:%7.2f,税金:%7.2f,实发工^:%10.2f.n,a[i].m[j].yuefen,a[i]-m[j]-yfgz,a[i].m[j].sf,a[i]m[j]-^an]-m[j]-sj»a[n-m[j]-sfgz),)printf8、("总实发工资:。/olOf",a[i].zsfgz);b=0;while(b!=l&&b!=2){printf("l,继续查询An2,返回主菜单An");scanf("%d",&b);}if(b==l){gotolabel一3;}elsei;return;}}}voidliulan(){structworkerx;intc;floatd;inti;intj;intk;for(i=0;i
5、ingming);for(j=0;a[i].m[j].yuefen!=NULL;j++){printf("月份:%5d,应发工资:。/ol0.2f,水费:%7.2f,电费:%7.2f,税金:%7.2f,实发工^:%10.2f.,f,a[i].m[j].yuefen,a[i]mrjl-yfgz,a[i].mrj].sf,afi]-mrj]-dfXil-mrj]sj,a[i]-nirj].sfgz);}printf("总实发工资:。/olOf",a[i].zsfgz);b=0;while(b!=l&
6、&b!=2){printf("l,继续査询An2,返回主菜单An");scanf("%d",&b);}if(b==l)igotolabel_3;}else{;return;}}else{intd=0;while(!(d〉=10001&&d<=32767)){printf("请输入您的卡号(五位数字),例如:10001H);scanf("%d",&d);}i=0;while(a[i].kahao!=d&&i7、字或川卡号查询n);return;}printf("%-10d%-20s",d,a[i].xingming);for(j=0;a[i].m[j].yuefen!=NULL;j++){printf("月份:%5d,应发工资:%10.2f,水费:%7.2f,电费:%7.2f,税金:%7.2f,实发工^:%10.2f.n,a[i].m[j].yuefen,a[i]-m[j]-yfgz,a[i].m[j].sf,a[i]m[j]-^an]-m[j]-sj»a[n-m[j]-sfgz),)printf8、("总实发工资:。/olOf",a[i].zsfgz);b=0;while(b!=l&&b!=2){printf("l,继续查询An2,返回主菜单An");scanf("%d",&b);}if(b==l){gotolabel一3;}elsei;return;}}}voidliulan(){structworkerx;intc;floatd;inti;intj;intk;for(i=0;i
7、字或川卡号查询n);return;}printf("%-10d%-20s",d,a[i].xingming);for(j=0;a[i].m[j].yuefen!=NULL;j++){printf("月份:%5d,应发工资:%10.2f,水费:%7.2f,电费:%7.2f,税金:%7.2f,实发工^:%10.2f.n,a[i].m[j].yuefen,a[i]-m[j]-yfgz,a[i].m[j].sf,a[i]m[j]-^an]-m[j]-sj»a[n-m[j]-sfgz),)printf
8、("总实发工资:。/olOf",a[i].zsfgz);b=0;while(b!=l&&b!=2){printf("l,继续查询An2,返回主菜单An");scanf("%d",&b);}if(b==l){gotolabel一3;}elsei;return;}}}voidliulan(){structworkerx;intc;floatd;inti;intj;intk;for(i=0;i
此文档下载收益归作者所有