教师工资管理系统课程设计报告.docx

上传人:小飞机 文档编号:1909000 上传时间:2022-12-25 格式:DOCX 页数:34 大小:228.94KB
返回 下载 相关 举报
教师工资管理系统课程设计报告.docx_第1页
第1页 / 共34页
教师工资管理系统课程设计报告.docx_第2页
第2页 / 共34页
教师工资管理系统课程设计报告.docx_第3页
第3页 / 共34页
教师工资管理系统课程设计报告.docx_第4页
第4页 / 共34页
教师工资管理系统课程设计报告.docx_第5页
第5页 / 共34页
点击查看更多>>
资源描述

《教师工资管理系统课程设计报告.docx》由会员分享,可在线阅读,更多相关《教师工资管理系统课程设计报告.docx(34页珍藏版)》请在三一办公上搜索。

1、 新能源与动力工程学院课程设计报告程序设计课程设计(C/C+) 专业电子信息工程 班级电信1501班 姓名郭秀琴 学号201512315 指导教师王慧敏2016年 12 月新能源与动力工程学院课程设计任务书课程名称: C语言程序设计课程设计 指导教师(签名): 班级: 电信1501班 姓名: 郭秀琴 学号: 201512315 一、课程设计题目教师工资管理系统二、课程设计使用的原始资料(数据)及设计技术要求:1教材2课程设计说明书三、课程设计的目的通过课程设计,主要达到以下目的:1使学生增进对程序设计的感性认识,加深对C语言理论方面的理解;2使学生掌握C语言程序的内部函数模块的应用。3使学生了

2、解和掌握C语言程序设计的软硬件设计过程、方法及实现,为以后设计程序系统打下良好基础。四、课程设计的主要内容和要求该程序是教师工资系统管理,主要用到结构体、函数的调用、以及一些基本的运算函数以及输入输出函数五、工作进度安排时间设计内容要求12月20日熟悉题目、查阅资料,拟定设计方案按要求制定出切实可行的方案12月21日设计程序构造及完成函数调用查询完成系统结构及部分程序设计12月22日23日充分调用各类函数完成剩余部分程序先进行程序组装及完成部分程序调试12月24日25日产品整理调试并完成设计报告实现设计要求,报告按要求装订成册12月26日答 辩展示产品,并简明扼要自述五分钟六、主要参考文献(1

3、)StephenPrimer Plus著 由云巅工作室 译 北京:人民邮电出版社2014年12月(2)谭浩强.程序设计(第四版)北京:清华大学出版社2010年6月审核批准意见系主任(签字) 年 月 日指导教师评语及成绩评定表指导教师评语成绩设计过程(40)设计报告(50)小组答辩(10)总成绩(100)指导教师签字: 年 月 日目 录一、设计目的.1二、总体设计.1三、详细设计.2四、程序测试.6五、运行结果.6六、结论与心得.8参考文献.10一、设计目的该系统是为了完成教师工资的管理,各个队友分工合作最后完成教师工资的管理系统,以便更好更方便的管理教师工资。1删除、统计等功能的实现;2基本掌

4、握面向过程程序设计的基本思路和方法,达到熟练掌握C语言的基本知识和技能,能够利用所学到的知识和技能,解决简单的程序设计问题。为了能够方便对教师的工资进行管理,对信息进行排序、插入、查找;3培养上机动手能力,使学生巩固C语言程序设计课程的学习内容,掌握如何使用面向过程的计算机语言进行程序设计的基本方法,强化上机动手能力,闯过编程关为后续各门计算机课程的学习打下坚实基础;4掌握各类C语言函数的使用方法及技巧,充分运用各级C语言函数完成简单程序的设计与运行;二、需求分析(1)教师信息处理。该模块包括教师信息的输入、修改、删除以及浏览和统计等功能,每个模块在程序系统中用一个函数来实现,模块总体框图如图

5、(1)所示信息输入教师信息处理信息删除信息修改浏览信息图一(1)模式框架图;(2)教师数据处理。该系统包括以下大板块:A、在数据处理过程中会根据教师号录入教师的基本工资、津贴、生活补贴补贴、电话费、水电费、房租、所得税、卫生费、公积金等基本数据;B、教师实发工资,应发工资,合计扣款计算;C、教师数据管理;D、教师数据查询;E、教师综合信息输出;三、详细设计(1)总体的流程图;选择浏览数据输出界面选择操作选择选择读取文件输入数据执行freeal退出系统结 束负责辅助信息的采集与数据处理郭秀琴(2)任务分配;马强强负责数据的记录教师工资管理系统负责信息的采集与数据处理支琴琴负责程序的调试与程序的删

6、改王亚雄(3)辅助信息的采集与数据处理A、了解教师工资的具体管理与发放情况;B、进行基本运算函数的确定与改写;C、主函数、结构体函数、调用函数的确定;第一部分struct teacher *creat();struct teacherchar num11;char name10;char sex8;char unit10;char address10;long telnum;float salary_1;float allowance;float life_allow;float salary_2;float tel_fee;float tax;float health_fee;float w

7、ater_fee;float rent;float grant;float total_fee;float actual_salary;struct teacher *next;第二部分struct teacher *insert(struct teacher*head,struct teacher *teach)struct teacher *p0,*p1,*p2;p1=head;p0=teach;if(head=NULL)head=p0;p0-next=NULL;elsewhile(p0-nump1-num)&(p1-next!=NULL)p2=p1;p1=p1-next;if(p0-nu

8、mnum)if(head=p1)head=p0;else p2-next=p0;p0-next=p1;elsep1-next=p0;p0-next=NULL;n=n+1;return(head);四、程序调试与错误分析1刚开始运行插入函数时,总不能插入正确信息2开始编译排序函数时出现无法正确插入函数及无法输出正确结果的情况。3编译查询函数时,总是无法输出正确信息。4各级函数调用出现很大问题,对函数使用不当以及函数调用的错误都造成了很多错误。5对删除函数的调用错误,导致输出结果错误。6对于很多C语句的使用不够熟练,出错较多。7针对以上错误,我虚心求教,向老师和同学求教,并顺利解决了程序编译过程中

9、出现的问题和错误,成功的完成了本程序的编译五、运行结果进入页面 图2程序的输入 图3程序的输出 图4六、结论与心得课程设计是培养学生综合运用所学知识、发现、提出、分析和解决实际问题,锻炼实践能力的重要环节,是对学生实际工作能力的具体训练和考察过程。教师工资管理系统这个题目很大,设计量也很大,也很繁琐,让我认识到这个课题非一人可以解决。但从另一方面,为了出色地完成这次课程设计,我不断地细读课本,获得新知识的同时,提升了自己的能力。更重要的是我们进行了团队合作。整个设计分模块实现功能,每个模块分别有不同的函数。每个同学都有自己的分工。链表的建立实现输入信息功能,相比较于数组更加方便,更加节省程序的

10、运行时间和存储空间。通过使用文件fread和write函数方便的将数据信息写入文件并载入显示段。通过这十几天的训练和设计与团队合作,我学会了很多,也对C语言程序设计有了一个新的认识与理解,从中也得到了很多乐趣,在这两周时间里看到同学们自己的劳动成果还是挺开心。而C语言的设计为自己以独立编程打下了基础。参考文献1【美】Stephen PrataPrimer Plus著 由云巅工作室 译。北京:人民邮电出版社2014年12月。2 谭浩强.程序设计(第四版)北京:清华大学出版社2010年6月。附录一部分源程序#include#include#include#define LEN sizeof(str

11、uct teacher)struct teacher *creat();struct teacherchar num11;char name10;char sex8;char unit10;char address10;long telnum;float salary_1;float allowance;float life_allow;float salary_2;float tel_fee;float tax;float health_fee;float water_fee;float rent;float grant;float total_fee;float actual_salary

12、;struct teacher *next;int n;struct teacher *head;FILE *fp;struct teacher *creat(void)struct teacher *p1,*p2;n=0;p1=p2=(struct teacher *)malloc(LEN);printf(教师号:);scanf(%d,&p1-num);fflush(stdin);printf(教师姓名:);gets(p1-name);printf(教师性别:);gets(p1-sex);printf(单位名称:);gets(p1-unit);printf(家庭地址:);gets(p1-ad

13、dress);printf(电话号码:);scanf(%ld,&p1-telnum);fflush(stdin);printf(基本工资:);scanf(%f,&p1-salary_1);fflush(stdin);printf(津贴:);scanf(%f,&p1-allowance);fflush(stdin);printf(生活补贴:);scanf(%f,&p1-life_allow);fflush(stdin);printf(电话费:);scanf(%f,&p1-tel_fee);fflush(stdin);printf(个人所得税:);scanf(%f,&p1-tax);fflush(

14、stdin);printf(房租:);scanf(%f,&p1-rent);fflush(stdin);printf(公积金:);scanf(%f,&p1-grant);fflush(stdin);printf(水电费:);scanf(%f,&p1-water_fee);fflush(stdin);printf(卫生费:);scanf(%f,&p1-health_fee);fflush(stdin); p1-salary_2=p1-salary_1+p1-allowance+p1-life_allow; p1-total_fee=p1-tel_fee+p1-water_fee+p1-rent+

15、p1-tax+p1-health_fee+p1-grant; p1-actual_salary=p1-salary_2-p1-total_fee; head=NULL;while(p1-num!=0)n=n+1;if(n=1)head=p1;else p2-next=p1;p2=p1;p1=(struct teacher*)malloc(LEN);printf(教师号:);scanf(%d,&p1-num);fflush(stdin);printf(教师姓名:);gets(p1-name);printf(教师性别:);gets(p1-sex);printf(单位名称:);gets(p1-uni

16、t);printf(家庭地址:);gets(p1-address);printf(电话号码:);scanf(%ld,&p1-telnum);fflush(stdin);printf(基本工资:);scanf(%f,&p1-salary_1);fflush(stdin);printf(津贴:);scanf(%f,&p1-allowance);fflush(stdin);printf(生活补贴:);scanf(%f,&p1-life_allow);fflush(stdin);printf(电话费:);scanf(%f,&p1-tel_fee);fflush(stdin);printf(个人所得税:

17、);scanf(%f,&p1-tax);fflush(stdin);printf(房租:);scanf(%f,&p1-rent);fflush(stdin);printf(公积金:);scanf(%f,&p1-grant);fflush(stdin);printf(水电费:);scanf(%f,&p1-water_fee);fflush(stdin);printf(卫生费:);scanf(%f,&p1-health_fee);fflush(stdin); p1-salary_2=p1-salary_1+p1-allowance+p1-life_allow; p1-total_fee=p1-te

18、l_fee+p1-water_fee+p1-rent+p1-tax+p1-health_fee+p1-grant; p1-actual_salary=p1-salary_2-p1-total_fee; p2-next=NULL;return(head);void print(struct teacher *head)struct teacher *p;printf(nNow,These %d records are:n,n);p=head;if(head!=NULL)doprintf(教师号:%5dtt,p-num);printf(教师姓名:%-10sn,p-name);printf(教师性别

19、:%-6stt,p-sex);printf(单位名称:%-10sn,p-unit);printf(家庭地址:%-10st,p-address);printf(电话号码:%8ldn,p-telnum);printf(基本工资:%5.0ftt,p-salary_1);printf(津贴:%5.0fn,p-allowance);printf(生活补贴:%5.0ft,p-life_allow);printf(t电话费:%5.0fn,p-tel_fee);printf(个人所得税:%5.0ft,p-tax);printf(卫生费:%5.0fn,p-health_fee);printf(水电费:%5.0f

20、tt,p-water_fee);printf(房租:%5.0fn,p-rent);printf(公积金:%5.0ftt,p-grant);printf(应发工资:%5.0fn,p-salary_2);printf(合计扣款:%5.0ftt,p-total_fee);printf(实发工资:%5.0fnnn,p-actual_salary);p=p-next;while(p!=NULL);struct teacher *insert(struct teacher*head,struct teacher *teach)struct teacher *p0,*p1,*p2;p1=head;p0=te

21、ach;if(head=NULL)head=p0;p0-next=NULL;elsewhile(p0-nump1-num)&(p1-next!=NULL)p2=p1;p1=p1-next;if(p0-numnum)if(head=p1)head=p0;else p2-next=p0;p0-next=p1;elsep1-next=p0;p0-next=NULL;n=n+1;return(head);struct teacher *del(struct teacher *head,int number)struct teacher *p1,*p2;if(head=NULL)printf(nlist

22、 nulln);return(head);p1=head;while(number!=p1-num&p1-next!=NULL)p2=p1;p1=p1-next;if(number=p1-num)if(p1=head)head=p1-next;else p2-next=p1-next;printf(删除:%dn,number);n=n-1;else printf(%ld is not foundn,number);return(head);void save() int i;struct teacher *p1; p1=head; if(fp=fopen(teacher_list,wb)=NU

23、LL) printf(cannot open filen); return; for(i=0;inext; fclose(fp);void load()struct teacher *p1,*p2;if(fp=fopen(teacher_list,rb)=NULL) printf(cannot open filen); return; p1=p2=(struct teacher *)malloc(LEN);head=p1;do if(fread(p1,sizeof(struct teacher),1,fp)!=1) printf(file errorn);goto end; if(p1-nex

24、t!=NULL) p2=p1; p1=(struct teacher *)malloc(LEN); p2-next=p1; else break; while(1); end: fclose(fp);void query(struct teacher *p) int no;p=head;printf(please input num:n);scanf(%d,&no); while(p-num!=no)p=p-next;printf(基本工资:%5.0ftt,p-salary_1);printf(津贴:%5.0fn,p-allowance);printf(生活补贴:%5.0ft,p-life_a

25、llow);printf(t电话费:%5.0fn,p-tel_fee);printf(个人所得税:%5.0ft,p-tax);printf(卫生费:%5.0fn,p-health_fee);printf(水电费:%5.0ftt,p-water_fee);printf(房租:%5.0fn,p-rent);printf(公积金:%5.0ftt,p-grant);printf(应发工资:%5.0fn,p-salary_2);printf(合计扣款:%5.0ftt,p-total_fee);printf(实发工资:%5.0fnnn,p-actual_salary);void edit(struct t

26、eacher *p)int a;printf(please input num:n);scanf(%d,&a);printf(%dnn,a);for(;)if(p-num=a)printf(教师号:%5dtt,p-num);printf(教师姓名:%-10sn,p-name);printf(教师性别:%-6stt,p-sex);printf(单位名称:%-10sn,p-unit);printf(家庭地址:%-10st,p-address);printf(电话号码:%8ldn,p-telnum);printf(基本工资:%5.0ftt,p-salary_1);printf(津贴:%5.0fn,p

27、-allowance);printf(生活补贴:%5.0ft,p-life_allow);printf(t电话费:%5.0fn,p-tel_fee);printf(个人所得税:%5.0ft,p-tax);printf(卫生费:%5.0fn,p-health_fee);printf(水电费:%5.0ftt,p-water_fee);printf(房租:%5.0fn,p-rent);printf(公积金:%5.0ftt,p-grant);printf(应发工资:%5.0fn,p-salary_2);printf(合计扣款:%5.0ftt,p-total_fee);printf(实发工资:%5.0f

28、nnn,p-actual_salary);printf(请输入新数据:n);printf(教师号:);scanf(%d,&p-num);fflush(stdin);printf(教师姓名:); gets(p-name);printf(教师性别:); gets(p-sex);printf(工作单位:); gets(p-unit);printf(家庭地址:); gets(p-address);printf(电话号码:);scanf(%ld,&p-telnum);fflush(stdin);printf(基本工资:);scanf(%f,&p-salary_1);fflush(stdin);print

29、f(津贴:);scanf(%f,&p-allowance);fflush(stdin);printf(生活补贴:);scanf(%f,&p-life_allow);fflush(stdin);printf(电话费:);scanf(%f,&p-tel_fee);fflush(stdin);printf(个人所得税:);scanf(%f,&p-tax);fflush(stdin);printf(房租:);scanf(%f,&p-rent);fflush(stdin);printf(公积金:);scanf(%f,&p-grant);fflush(stdin);printf(水电费:);scanf(%

30、f,&p-water_fee);fflush(stdin);printf(卫生费:);scanf(%f,&p-health_fee);fflush(stdin); p-salary_2=p-salary_1+p-allowance+p-life_allow; p-total_fee=p-tel_fee+p-water_fee+p-rent+p-tax+p-health_fee+p-grant; p-actual_salary=p-salary_2-p-total_fee; break; p=p-next;void welcome() printf(ttt+-+n); printf(ttt| |

31、n); printf(ttt| 欢迎使用教师工资管理系统 |n); printf(ttt| |n); printf(ttt+-+n); printf(nn); char mainmenu() char choice;printf(n温馨提示:为保证您的操作得到保存,请按正常顺序退出系统_n);printf(nn); printf(ttt-n); printf(ttt| 教师工资管理系统 |n); printf(ttt-n); printf(ttt| 1-输入教师信息 |n); printf(ttt| 2-插入教师信息 |n); printf(ttt| 3-删除教师信息 |n); printf(

32、ttt| 4-浏览教师信息 |n); printf(ttt| 5-录入教师信息 |n);printf(ttt| 6-查询教师信息 |n); printf(ttt| 7-修改教师信息 |n); printf(ttt| 8-加载教师信息 |n);printf(ttt| 0-退出系统 |n); printf(ttt|*|n); printf(ttt-n); printf(请输入您的选择:); dofflush(stdin);scanf(%c,&choice);fflush(stdin);while(choice8);return(choice); case 0: system(cls);exit(0

33、); case 1: printf(input records:n);head=creat();break; case 2:printf(input the inserted record:n);teach=(struct teacher *)malloc(LEN);printf(教师号:);scanf(%d,&teach-num);fflush(stdin);printf(教师姓名:); gets(teach-name);printf(教师性别:); gets(teach-sex);printf(单位名称:); gets(teach-unit);printf(家庭地址:); gets(tea

34、ch-address);printf(电话号码:);scanf(%ld,&teach-telnum);fflush(stdin);printf(基本工资:);scanf(%f,&teach-salary_1);fflush(stdin);printf(津贴:);scanf(%f,&teach-allowance);fflush(stdin);printf(生活补贴:);scanf(%f,&teach-life_allow);fflush(stdin);printf(电话费:);scanf(%f,&teach-tel_fee);fflush(stdin);printf(个人所得税:);scanf

35、(%f,&teach-tax);fflush(stdin);printf(房租:);scanf(%f,&teach-rent);fflush(stdin);printf(公积金:);scanf(%f,&teach-grant);fflush(stdin);printf(水电费:);scanf(%f,&teach-water_fee);fflush(stdin);printf(卫生费:);scanf(%f,&teach-health_fee);fflush(stdin); teach-salary_2=teach-salary_1+teach-allowance+teach-life_allow

36、; teach-total_fee=teach-tel_fee+teach-water_fee+teach-rent+teach-tax+teach-health_fee+teach-grant; teach-actual_salary=teach-salary_2-teach-total_fee; head=insert(head,teach);print(head);break; case 3: printf(input the delete number:);scanf(%d,&del_num);getchar();head=del(head,del_num);print(head);break; case 4: print(head); break; case 5: save(); break; case 6:query(head);break;case 7:edit(head);break;case 8:load();break; -30-

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号