c语言程序设计教师工资管理系统.docx
- 文档编号:14699605
- 上传时间:2023-06-26
- 格式:DOCX
- 页数:13
- 大小:21.81KB
c语言程序设计教师工资管理系统.docx
《c语言程序设计教师工资管理系统.docx》由会员分享,可在线阅读,更多相关《c语言程序设计教师工资管理系统.docx(13页珍藏版)》请在冰点文库上搜索。
c语言程序设计教师工资管理系统
二、总体设计
(对设计目标进行总体分析,说明要采用的基本思路,说明遇到的问题和解决方法。
说明完成本次课程设计的完整过程。
要描述程序的设计思想,画出本次课程设计完整的程序框图或流程图。
)
三、详细设计
(要求列出所有编写的函数清单,说明每个函数的功能,各形式参数的意义,画出各函数的调用关系图。
即模块功能说明(如函数功能、入口及出口参数说明,函数调用关系描述等)。
)
四、程序运行结果测试与分析
(要针对程序处理的不同情况列出有代表性的输入和输出,用足够多的实例说明程序完成了设计任务和目标。
)
五、结论与心得
(主要说明程序调试中发现的问题和解决办法,包括你在该设计中主要承担什么任务,在设计中学到了什么,哪里遇到了困难,解决的办法,可能但因时间关系没有来得及完成的想法,今后的目标等。
)
要求:
课程设计进行一周,每天班长负责考勤,旷课一次扣1。
5分
提交内容:
课程设计报告,做好的程序给我演示
c语言程序设计教师工资管理系统_具体的设计报告
教师工资管理系统
每个教师的信息为:
教师号、姓名、性别、单位名称、家庭住址、联系电话、基本工资、津贴、生活补贴、应发工资、电话费、水电费、房租、所得税、卫生费、公积金、合计扣款、实发工资。
注:
应发工资=基本工资+津贴+生活补贴;合计扣款=电话费+水电费+房租+所得税+卫生费+公积金;实发工资=应发工资-合计扣款。
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.总体设计
建立动态链表。
删除结点
插入结点
三、详细设计
源程序
#include〈stdio.h〉#include〈stdlib。
h>#include〈conio。
h>
#defineLENsizeof(structteacher)structteacher*creat();structteacher{intnum;charname[10];charsex[8];charunit[10];charaddress[10];longtelnum;floatsalary_1;floatallowance;floatlife_allow;floatsalary_2;floattel_fee;floattax;floathealth_fee;floatwater_fee;floatrent;floatgrant;floattotal_fee;floatactual_salary;structteacher*next;};
intn;
structteacher*head;FILE*fp;
structteacher*creat(void){structteacher*p1,*p2;n=0;p1=p2=(structteacher*)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;elsep2—〉next=p1;p2=p1;p1=(structteacher*)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);}
voidprint(structteacher*head){structteacher*p;printf(”\nNow,These%drecordsare:
\n",n);p=head;if(head!
=NULL)do{printf(”教师号:
%5d\t\t”,p-〉num);printf(”教师姓名:
%-10s\n",p-〉name);printf("教师性别:
%—6s\t\t”,p-〉sex);
printf("单位名称:
%—10s\n",p->unit);printf(”家庭地址:
%—10s\t",p-〉address);printf("电话号码:
%8ld\n",p—>telnum);printf(”基本工资:
%5。
0f\t\t",p—〉salary_1);printf("津贴:
%5.0f\n",p-〉allowance);printf("生活补贴:
%5.0f\t”,p—〉life_allow);printf(”\t电话费:
%5。
0f\n”,p-〉tel_fee);printf(”个人所得税:
%5。
0f\t",p-〉tax);printf("卫生费:
%5。
0f\n",p->health_fee);printf(”水电费:
%5。
0f\t\t",p->water_fee);printf("房租:
%5.0f\n",p—>rent);printf(”公积金:
%5.0f\t\t",p->grant);printf("应发工资:
%5.0f\n”,p—>salary_2);printf(”合计扣款:
%5。
0f\t\t”,p->total_fee);printf("实发工资:
%5。
0f\n\n\n",p—〉actual_salary);p=p-〉next;}while(p!
=NULL);}
structteacher*insert(structteacher*head,structteacher*teach){structteacher*p0,*p1,*p2;p1=head;p0=teach;if(head==NULL){head=p0;p0—〉next=NULL;}else{while((p0—〉num>p1—〉num)&&(p1-〉next!
=NULL)){p2=p1;p1=p1->next;}if(p0->num
}
structteacher*del(structteacher*head,intnumber){structteacher*p1,*p2;if(head==NULL){printf(”\nlistnull\n");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;elsep2—>next=p1->next;printf(”删除:
%d\n",number);n=n-1;}elseprintf(”%ldisnotfound\n”,number);return(head);}
voidsave(){inti;
structteacher*p1;p1=head;
if((fp=fopen(”teacher_list","wb"))==NULL){printf("cannotopenfile\n”);return;}
for(i=0;i {if(fwrite(p1,sizeof(structteacher),1,fp)! =1)printf(”filewriteerror\n”);p1=p1->next;} fclose(fp);} voidload(){ structteacher*p1,*p2; if((fp=fopen("teacher_list”,”rb"))==NULL){printf(”cannotopenfile\n");return;} p1=p2=(structteacher*)malloc(LEN);head=p1;do{ if(fread(p1,sizeof(structteacher),1,fp)! =1){printf("fileerror\n");gotoend;} if(p1->next! =NULL){p2=p1; p1=(structteacher*)malloc(LEN);p2->next=p1;}elsebreak;}while (1);end: fclose(fp);} voidquery(structteacher*p){intno;p=head;printf("pleaseinputnum: \n");scanf("%d”,&no); while(p—>num! =no)p=p->next; printf("基本工资: %5.0f\t\t”,p-〉salary_1);printf(”津贴: %5。 0f\n”,p->allowance);printf("生活补贴: %5。 0f\t”,p-〉life_allow);printf("\t电话费: %5。 0f\n",p—〉tel_fee);printf(”个人所得税: %5.0f\t",p—>tax); printf(”水电费: %5.0f\t\t",p—〉water_fee);printf(”房租: %5。 0f\n",p—〉rent);printf("公积金: %5。 0f\t\t",p—>grant);printf("应发工资: %5.0f\n",p->salary_2);printf("合计扣款: %5。 0f\t\t",p-〉total_fee);printf("实发工资: %5。 0f\n\n\n”,p—〉actual_salary);} voidedit(structteacher*p){inta;printf(”pleaseinputnum: \n”);scanf(”%d”,&a);printf("%d\n\n”,a);for(;;){if(p—>num==a){printf(”教师号: %5d\t\t”,p—>num);printf(”教师姓名: %—10s\n”,p->name);printf("教师性别: %—6s\t\t”,p->sex);printf("单位名称: %—10s\n",p—>unit);printf(”家庭地址: %-10s\t",p-〉address);printf(”电话号码: %8ld\n",p—>telnum);printf("基本工资: %5。 0f\t\t”,p->salary_1);printf("津贴: %5.0f\n",p->allowance);printf(”生活补贴: %5。 0f\t",p->life_allow);printf("\t电话费: %5。 0f\n",p—〉tel_fee);printf(”个人所得税: %5.0f\t”,p—>tax);printf("卫生费: %5.0f\n”,p->health_fee);printf(”水电费: %5.0f\t\t",p->water_fee);printf("房租: %5。 0f\n",p->rent);printf("公积金: %5.0f\t\t",p-〉grant); printf(”合计扣款: %5。 0f\t\t",p—>total_fee);printf("实发工资: %5。 0f\n\n\n”,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;}} voidwelcome(){ printf("\t\t\t+—-—-—--————------—--—-—--—-+\n"); printf("\t\t\t||\n"); printf("\t\t\t|欢迎使用教师工资管理系统|\n"); printf("\t\t\t||\n"); printf(”\t\t\t+—---————--—----—-———-—-—-——+\n”); printf(”\n\n");} charmainmenu() {charchoice;printf(”\n温馨提示: 为保证您的操作得到保存,请按正常顺序退出系统^_^\n");printf(”\n\n”); printf(”\t\t\t--———-—----———-—----------------\n”);printf("\t\t\t|教师工资管理系统|\n”);printf("\t\t\t—-—-——-—--———-———-----—————-—-——\n”);printf(”\t\t\t|[1]----输入教师信息|\n”);printf(”\t\t\t|[2]—-—-插入教师信息|\n”);printf(”\t\t\t|[3]————删除教师信息|\n");printf(”\t\t\t|[4]-—-—浏览教师信息|\n");printf(”\t\t\t|[5]-——-录入教师信息|\n");printf("\t\t\t|[6]——-—查询教师信息|\n”);printf("\t\t\t|[7]—--—修改教师信息|\n”); printf(”\t\t\t|[8]—---加载教师信息|\n");printf(”\t\t\t|[0]—--—退出系统|\n”);printf(”\t\t\t|*·*·*·*·*·*·*·*·*·*·|\n");printf("\t\t\t-—----——------——--——-—————-——-—-\n");printf(”请输入您的选择: ”);do{fflush(stdin);scanf(”%c",&choice);fflush(stdin);}while(choice〈'0'||choice〉'8');return(choice);} voidmain() {structteacher*teach;intdel_num;charchoice;while (1){welcome();choice=mainmenu();switch(choice){case’0’:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言程序设计 教师工资 管理 系统