文档详情

员工的管理系统c语言源代码.doc

发布:2017-03-10约1.54万字共19页下载文档
文本预览下载声明
#includestring.h #includestdio.h #define N 10000????? /*员工的最大数*/ typedef struct wage { float wage1;????? /*员工的基本工资*/ float Bonus;???? /*员工的奖金*/ float tax;?????? /*员工的税金*/ float S_fee;???? /*员工的水费*/ float D_fee;???? /*员工的电费*/ float T_fee;???? /*员工的有线电视费*/ float Q_fee;???? /*员工的清洁费*/ float S_wage;???? /*员工的实发工资*/ }WAGE; typedef struct worker { ????? char name[10];?????? /*员工的姓名*/ char ID[10];???????? /*员工的工号*/ ????? int ID_P;??????????? /*员工的职务代号 1----高级工程师??? 2----中级工程师??? 3----初级工程师??? */ char ID_Wage[10];??? /*员工的工资卡号*/ char depart[10];???? /*员工的部门*/ ??? int age;???????????? /*员工的年龄*/ char sex;??????????? /*员工的性别*/ char m_phone[10];??? /*员工的手机*/ char H_phone[10];??? /*员工的住宅电话*/ ????? WAGE salary; }WORK; WORK wo[N]; int n;/*员工的总数*/ void menu();/*员工管理操作主菜单函数声明*/ void menu1();/*员工管理操作子菜单函数声明*/ /******************************************************** Author???? : GT CopyRight??? :?tgao@ ??? function name?????? : save ???? Comments??? : 保存文件函数 input???????????? :????? 无?? output??????????? :????? 无 CreatedDate??? : 2007/06/01 *********************************************************/ save()??????????????????????? /*保存函数,保存n个记录*/ {? int w=1; FILE *fp; int i; system( cls );? if((fp=fopen(work.txt,wb))==NULL)????? /*以输出打开方式,在此前的记录被覆盖*/ { ??? printf(\nCannot open file\n); ??? return NULL; } ????? for(i=0;in;i++) if(fwrite(wo[i],sizeof(struct worker),1,fp)!=1) {??????? ?????? printf(file write error\n); ??? w=0; } if(w==1) { ????? printf(file save ok!\n); } fclose(fp); getch();???? menu(); } /******************************************************** Author???? : GT CopyRight??? :?tgao@ ??? function name?????? : load ???? Comments??? : 载入文件函数 input???????????? :????? 无?? output??????????? :????? 无 CreatedDate??? : 2007/06/01 *********************************************************/ load()???????????????????????? /*加载记录或可以计算记录个数的函数*/ { FILE *fp; int i,w; w=1; system( cls );? if((fp=fopen(work.txt,rb))==NULL)????? /*以输出打开方式,在此前的记录被覆盖*/ { ??? printf(\nCannot open file\n);
显示全部
相似文档