收藏 分销(赏)

c语言职工工资管理系统设计.doc

上传人:天**** 文档编号:3066184 上传时间:2024-06-14 格式:DOC 页数:6 大小:18.50KB
下载 相关 举报
c语言职工工资管理系统设计.doc_第1页
第1页 / 共6页
c语言职工工资管理系统设计.doc_第2页
第2页 / 共6页
c语言职工工资管理系统设计.doc_第3页
第3页 / 共6页
c语言职工工资管理系统设计.doc_第4页
第4页 / 共6页
c语言职工工资管理系统设计.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、题目3:职工工资管理系统设计功能:实现简单的职工工资信息管理,职工工资的基本信息包括编号、姓名、基本工资、奖金、工资总额等 基本要求:1设计简单的菜单,能够进行系统功能选择。 2实现信息的录入功能。3在已有信息的基础上添加新的记录。 4删除指定编号的记录。 5修改指定编号的记录 6实现信息的浏览功能 7按编号查询功能8按工资总额排序功能 #include stdio.h#include stdlib.h#include ctype.h#include process.hstruct gongzi /*定义数组*/ int bianhao; char xingming10; int jbgz;/

2、*基本工资*/ int jiangjin; int tatal; struct gongzi *next;void print() /*菜单*/ printf(welcom!n); printf(1.创建新信息n); printf(2.删除原信息n); printf(3.修改原信息n); printf(4.按编号查找n); printf(5.工资总额排序n);struct gongzi * creat(struct gongzi*head) /*case1创建工资,降序排列*/ struct gongzi *p1, *p2, *p3; /*p1新增点,p2,p3切点*/ p1 =p2 =p3

3、=(struct gongzi * )malloc(sizeof(struct gongzi) );printf(创建新信息n输入编号,姓名,基本工资,奖金n); printf(输入编号);scanf(%d,&p1-bianhao); printf(输入姓名);scanf(%s,&p1-xingming); printf(输入基本工资);scanf(%d,&p1-jbgz);printf(输入奖金);scanf(%d,&p1-jiangjin); p1-tatal =p1-jbgz + p1-jiangjin; p1-next =NULL; if(head = NULL) head =p1;

4、else p2 =head; while(p2-tatal tatal) & (p2-next !=NULL) p3 =p2; p2 =p2-next; if(p1-tatal tatal)if(head = p1)head =p1;elsep3-next =p1;p1-next =p2; elsep2-next =p1;p1-next =NULL; return head;struct gongzi * del(struct gongzi*head) /*case2删除原信息*/int bianhao;struct gongzi *p1, *p2;printf(输入要删除的编号);if(he

5、ad = NULL)printf(nlist is null);goto end;p1=head;scanf(%d,&bianhao);while(bianhao != p1-bianhao) & (p1-next != NULL)p2 =p1;p1 =p1-next;if(bianhao =p1-bianhao)if(p1 = head)head =p1-next;elsep2-next =p1-next;printf(%d has been deleted.n,bianhao);elseprintf(%d not been found!n,bianhao);end:return(head)

6、;struct gongzi * change(struct gongzi*head) /*case 3修改原信息*/int bianhao;struct gongzi *p1, *p2;printf(输入要修改的编号);if(head = NULL)printf(nlist is null);goto end;p1=head;scanf(%d,&bianhao);while(bianhao != p1-bianhao) & (p1-next != NULL)p2 =p1;p1 =p1-next;if(bianhao =p1-bianhao)printf(输入编号);scanf(%d,&p1-

7、bianhao);printf(输入姓名);scanf(%s,&p1-xingming);printf(输入基本工资);scanf(%d,&p1-jbgz);printf(输入奖金);scanf(%d,&p1-jiangjin);p1-tatal =p1-jbgz + p1-jiangjin;p1-next =NULL;printf(%d has been change.n,bianhao);elseprintf(%d not been found!n,bianhao);end:return(head);struct gongzi * search(struct gongzi*head) /*

8、case4按编号查找*/int bianhao;struct gongzi *p1, *p2;printf(输入要查找的编号);if(head = NULL)printf(nlist is null);goto end;p1=head;scanf(%d,&bianhao);while(bianhao != p1-bianhao) & (p1-next != NULL)p2 =p1;p1 =p1-next;if(bianhao =p1-bianhao)printf(%5d%10s%5d%5d%5dn,p1-bianhao, p1-xingming,p1-jbgz, p1-jiangjin, p1

9、-tatal);elseprintf(%d not been found!n,bianhao);end:return(head);void list(struct gongzi*head) /*case5输出*/struct gongzi*p1;p1 =head;printf(编号、姓名、基本工资、奖金、工资总额n);if(head = NULL)printf(nlist is nulln);while(p1 != NULL)printf(%5d%10s%5d%5d%5dn,p1-bianhao, p1-xingming,p1-jbgz, p1-jiangjin, p1-tatal);p1 =

10、p1-next;main() int caidan, ch;struct gongzi*p; struct gongzi*head =NULL;loop:print(); scanf(%d,&caidan); switch(caidan) case 1: head =creat(head);getch(); break;case 2:head =del(head);getch();break;case 3:head =change(head);getch();break;case 4:head =search(head);getch();break;case 5:list(head);getch();break; goto loop;

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 通信科技 > 开发语言

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服