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

上传人:平*** 文档编号:10103766 上传时间:2017-10-06 格式:DOC 页数:19 大小:57.78KB
返回 下载 相关 举报
员工管理系统c语言源代码_第1页
第1页 / 共19页
员工管理系统c语言源代码_第2页
第2页 / 共19页
员工管理系统c语言源代码_第3页
第3页 / 共19页
员工管理系统c语言源代码_第4页
第4页 / 共19页
员工管理系统c语言源代码_第5页
第5页 / 共19页
点击查看更多>>
资源描述

《员工管理系统c语言源代码》由会员分享,可在线阅读,更多相关《员工管理系统c语言源代码(19页珍藏版)》请在金锄头文库上搜索。

1、#include#include#define N 10000 /*员工的最大数*/typedef struct wagefloat wage1; /*员工的基本工资*/float Bonus; /*员工的奖金 */float tax; /*员工的税金*/float S_fee; /*员工的水费*/float D_fee; /*员工的电费*/float T_fee; /*员工的有线电视费*/float Q_fee; /*员工的清洁费 */float S_wage; /*员工的实发工资*/WAGE;typedef struct workerchar name10; /*员工的姓名*/char I

2、D10; /*员工的工号*/int ID_P; /*员工的职务代号 1-高级工程师 2-中级工程师 3-初级工程师 */char ID_Wage10; /*员工的工资卡号 */char depart10; /*员工的部门*/int age; /*员工的年龄*/char sex; /*员工的性别*/char m_phone10; /*员工的手机*/char H_phone10; /*员工的住宅电话*/WAGE salary;WORK;WORK woN;int n;/*员工的总数*/void menu();/*员工管理操作主菜单函数声明*/void menu1();/*员工管理操作子菜单函数声明*

3、/*Author : GTCopyRight : function name : saveComments : 保存文件函数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 filen);return NULL;for(i=0;i9) /*判断员工编号是否为数字*/puts(Input

4、error! Only be made up of (0-9).Please reinput!n);w1=1;break; if(w1!=1)for(k=0;k800&s1400)tax=(s-1400)*0.1+600*0.05; return tax;/*Author : GTCopyRight : function name : inputComments : 输入一条员工记录input : i: 表示第 i 个的员工信息output : 无CreatedDate : 2007/06/01*/void input(int i) /*输入一个记录函数*/int j,sum;no_input

5、(i,i); /*调用员工编号输入函数*/printf(name:);fflush(stdin);gets(woi.name);printf(Bank ID:);fflush(stdin);gets(woi.ID_Wage);printf(grade);scanf(%d,&woi.ID_P); printf(Department:);fflush(stdin);gets(woi.depart);printf(age:);scanf(%d,&woi.age);printf(sex:);fflush(stdin);scanf(%c,&woi.sex); printf(mobile phone);f

6、flush(stdin);gets(woi.m_phone);printf(home phone);fflush(stdin);gets(woi.H_phone);printf(basic salary);scanf(%f,&woi.salary.wage1);woi.salary.tax=tax(woi.salary.wage1);printf(Bonus:);scanf(%f,&woi.salary.Bonus);printf(water fee:);scanf(%f,&woi.salary.S_fee);printf(dian fee:);scanf(%f,&woi.salary.D_f

7、ee);printf(QingJie fee:);scanf(%f,&woi.salary.Q_fee);printf(TV fee:);scanf(%f,&woi.salary.T_fee);woi.salary.S_wage=woi.salary.wage1+woi.salary.Bonus-woi.salary.tax-woi.salary.D_fee-woi.salary.Q_fee-woi.salary.S_fee-woi.salary.T_fee;/*Author : GTCopyRight : function name : enterComments : 输入员工管理系统信息记

8、录input : 无output : 无CreatedDate : 2007/06/01*/void enter()/*输入模块*/int i;system( cls ); printf(How many record(0-%d)?:,N);scanf(%d,&n); /*要输入的记录个数*/printf(nEnter data nownn);for(i=0;i=b_age&woi.agewok.salary.S_wage)k=j;s=woi;woi=wok;wok=s;printf(The ordered data is:n);browse();getch(); menu1();/*Auth

9、or : GTCopyRight : function name : menu1Comments : 员工管理操作的子菜单input : 无output : 无CreatedDate : 2007/06/01*/void menu1()int n,w1;dosystem( cls ); /*清屏*/puts(tttt 员工管理操作 !nn);puts(tt*MENU*nn);puts(tttt1.search by ID);puts(tttt2.search by age);puts(tttt3.count salary);puts(tttt4.order by salary);puts(tt

10、tt5.return to menu);puts(nntt*n);printf(Choice your number(1-5): bb);scanf(%d,&n);if(n5) /*对选择的数字作判断*/w1=1;printf(your choice is not between 1 and 4,Please input again:);getchar(); else w1=0; while(w1=1);/*选择功能*/switch(n)case 1:search_by_ID();break; /*输入模块*/case 2:search_by_age();break; /*浏览模块*/case

11、 3:count_by_P();break; /*查找模块*/case 4:order();break; /*浏览模块*/case 5:menu();/*Author : GTCopyRight : function name : menuComments : 员工管理系统主菜单input : 无output : 无CreatedDate : 2007/06/01*/void menu()int n,w1;dosystem( cls ); /*清屏*/puts(tttt 员工管理系统 !nn);puts(tt*MENU*nn);puts(tttt1.Enter new data); puts(tttt2.Browse all);puts(

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号