c语言程序设计教师工资管理系统具体的设计报告.docx_第1页
c语言程序设计教师工资管理系统具体的设计报告.docx_第2页
c语言程序设计教师工资管理系统具体的设计报告.docx_第3页
c语言程序设计教师工资管理系统具体的设计报告.docx_第4页
c语言程序设计教师工资管理系统具体的设计报告.docx_第5页
已阅读5页,还剩17页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

课程设计报告学院:天津理工大学华信软件学院专业名称:软件工程课程设计科目C语言课程设计所在班级:一班学生学号:20105945学生姓名:吴健指导教师:陈立娜完成时间:2011年4月-6月教师工资管理系统每个教师的信息为:教师号、姓名、性别、单位名称、家庭住址、联系电话、基本工资、津贴、生活补贴、应发工资、电话费、水电费、房租、所得税、卫生费、公积金、合计扣款、实发工资。注:应发工资=基本工资+津贴+生活补贴;合计扣款=电话费+水电费+房租+所得税+卫生费+公积金;实发工资=应发工资合计扣款。A、教师信息处理(1)输入教师信息(2) 插入(修改)教师信息:(3) 删除教师信息:(4) 浏览教师信息:提示:具体功能及操作参考题1。B、教师数据处理:(1) 按教师号录入教师基本工资、津贴、生活补贴、电话费、水电费、房租、所得税、卫生费、公积金等基本数据。(2) 教师实发工资、应发工资、合计扣款计算。提示:计算规则如题目。(3) 教师数据管理提示:输入教师号,读出并显示该教师信息,输入新数据,将改后信息写入文件(4) 教师数据查询:提示:输入教师号或其他信息,即读出所有数据信息,并显示出来。(5) 教师综合信息输出提示:输出教师信息到屏幕。1. 课程设计目的和要求A 巩固和加强c语言程序设计课程的理论知识。B 掌握c语言的基本概念,语法,语义和数据类型的使用特点。C 掌握c语言程序设计的方法及编程技巧,能正确使用c语言编写程序。D 进一步理解和运用结构化程序设计的思想和放法。E 使学生掌握调试程序的基本方法及上机操作方法。F 通过查询手册和文献资料,培养学生独立分析问题和解决问题的能力。G 初步掌握开发一个小型实用系统的基本方法。H 培养学生的创新能力和创新思维。I 培养学生良好的程序设计风格。进一步理解和运用2.课程设计题目及内容教师工资管理系统每个教师的信息为:教师名,姓名,性别,单位名称,家庭住址,联系电话,基本工资,津贴,生活补贴,应发工资,电话费,水电费,房租,所得税,卫生费,公积金,合计扣款,实发工资。注:应发工资=基本工资+津贴+生活补贴;合计扣款=电话费+水电费+房租+所得税+卫生费+公积金;实发工资=应发工资合计扣款。1教师信息处理J 输入教师信息K 插入(修改)教师信息L 删除教师信息;M 浏览教师信息;(提示:具体功能及操作参考题1。)2教师数据处理;A. 按教师号录入教师基本工资,津贴,生活补贴,电话费,水电费,房租,所得税,卫生费,公积金等基本信息;B. 教师实发工资、应发公资、合计扣款;C. 教师数据管理;(提示:输入教师号,读出并显示该教师信息,输入新数据,将改后信息写入文件。)D. 教师数据查询;(提示:输入教师好或其他信息,即读出所有数据信息,并显示出来。)E. 教师综合信息输出;(提示;输出教师信息到屏幕。)一、 需求分析 教师信息处理A输入教师信息B插入修改教师信息C删除教师信息D浏览教师信息 教师数据处理A按教师号录入教师基本工资、津贴、生活补贴、电话费、水电费、房租、所得税、卫生费、公积金等基本数据。B教师实发工资,应发工资,合计扣款计算。C教师数据管理D教师数据查询E教师综合信息输出二总体设计4总体设计、输出界面选择操作选择0读取文件执行freeall()退出系统选择1输入数据Break结束选择2浏览数据break选择3查询数据Break选择4选择5删除数据修改数据BreakBreak输出:无效选项Break结束建立动态链表。开辟一个新结点,并使p1,p2指向它读入一个老师数据给P1所指的结点head=NULL n=0当读入的p1-num!=0表尾结点的指针变量置NULLn=n+1真 n=1 假head=p1 p2-next=p1把p1所指的结点把p1所指的结点作为第一结点连接到表尾p2=p1在开辟一个新结点,使p1指向它读入一个老师数据给p1所指结点删除结点真链表是一个空表假 p1=head当num!=p1-num以及p1所指的结点不是表尾结点结点 p2=p1 p1=p1-next是 p1是要删除的结点否是 p1所指的头结点否输出找 head=p1-next p2-next= 不到的信息 p1-next 息输出空表插入结点p1=head,p0=stud是原来的链表是空表否当p0-nump1-num以及p1所指的不是表尾结点将p0所 p2指向p1位置指的结 p1向后移一个结点点作为 p0-numnum唯一的真假结点是p1指向头结点否 p1-next=p0head=p0 p2-next=p0 p0-next=NULL p0-next=p1 p0-next=p1修改调用query函数查找到相关结点地址修改相关结点的值域是否存在该教师信息修改完毕三、详细设计源程序#include#include#include#define LEN sizeof(struct teacher)struct teacher *creat();struct teacherintnum;char name10;char sex8;char unit10;char address10;longtelnum;float salary_1;float allowance;floatlife_allow;float salary_2;floattel_fee;float tax;floathealth_fee;floatwater_fee;float rent;float grant;floattotal_fee;floatactual_salary;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-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(个人所得税:);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-tel_fee+p1-water_fee+p1-rent+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-unit);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(个人所得税:);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-tel_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(教师性别:%-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.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);p=p-next;while(p!=NULL);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-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 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)=NULL) 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-next!=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_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.0fnnn,p-actual_salary);void edit(struct teacher *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-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.0fnnn,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);printf(津贴:);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(%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| |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(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);void main()struct teacher *teach;intdel_num;char choice;while(1)welcome(); choice=mainmenu();switch(choice) case 0: system(cls);exit(0); 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(teach-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(%f,&teach-tax);fflush(stdin);print

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论