c语言程序设计学生考勤系统,C语言课程设计学生考勤系统最终版(样例3)

《C语言课程设计学生考勤系统.doc》由会员分享,可免费在线阅读全文,更多与《C语言课程设计学生考勤系统(最终版)》相关文档资源请在帮帮文库(www.woc88.com)数亿文档库存里搜索。

1、rite(,LEN,,f);=gtnext;}fclose(f);rintf(quot\t\t\t创建成功,按任意键返回主菜单\nquot);getch();system(quotclsquot);退出mune_();switch结构switch(sub){case:{gtmath+=num;}eak;case:{gtEnglish+=num;}eak;case:{gthysics+=num;}eak;case:{gtMks+=num;}eak;case:{gtC+=num;}eak;case:{gtteal+=num;}eak;case:{gtPE+=num;}eak;}while结构while(!=NULL){if(gtnum==a){rintf(quot\n\t\t请重新输入高等数学缺勤节数:quot);scanf(quot%dquot,amgtmath);rintf(quot\n\t\t请重新输入大学英语缺勤节数:quot);scanf(quot%dquot,amgtEnglish);rintf(quot\n\t\t请输入大学物理缺勤节数:quot);scanf(quot%dquot,amgthysics);rintf(quot\n\t\t请重新输入马克思主义基本原理与概论缺勤节数:quot);scanf(quot%dquot,amgtMks);rintf(quot\n\t\t请重新输入C语言缺勤节数:quot);scanf(quo。

2、你要创建班级的名称(如果要创建的文件已存在,将覆盖原文件):quot);gets(filename);strcat(filename,quotdatquot);if((f=foen(filename,quotwbquot))==NULL){rintf(quotcannotoenfile\nquot);exit();}rintf(quot请输入学生的基本信息:姓名、座号、性别\nquot);scanf(quot%s%d%squot,gtname,amgtnum,gtsex);gtmath=gtEnglish=gthysics=gtMks=gtC=gtteal=gtPEtStudent*load(char[]);voidenter(void);*录入函数*voidsearch_(void);*查询函数_*voidsearch_(void);*查询函数_*voidmodify(void);*修改函数*voidback(void);*退出函数*voidmune_();*界面*voidmune_();*界面*mune_();mune_();rintf(quot\nquot);}voidmune_(){rintf(quot\n\n\n\n\n\nquot);rintf(quot\t************************************************************quot);rintf(quot\t\t\t*****。

3、;return(head);}voidenter()*录入函数*{structStudent*head,*;charselect='y',cla[];intsub,stu,num,flag=;rintf(quot请输入上课班级:quot);scanf(quot%squot,cla);strcat(cla,quotdatquot);=head=load(cla);system(quotclsquot);while(select=='y'||select=='Y'){rintf(quot\n\n\nquot);rintf(quot\t*************************班的考勤信息返回菜单voidsave(structStudent*,char[]);structStudent*load(charfilename[])开始数据写入文件关闭文件退出打开文件开始打开文件读出数据返回菜单结构的应用Ifelse结构和while结构嵌套结构:while(gtnum!=){n=n+;if(n==)head=;elsegtnext=;=;=(structStudent*)malloc(LEN);scanf(quot%s%d%squot,gtname,amgtnum,gtsex);gtmath=gtEnglish=gthysics=gtMks=gtC=gtteal=gtPE=;}gtnext=NULL;=head;while(!=NULL){fw。

4、:quot);scanf(quot%dquot,amgtEnglish);rintf(quot\n\t\t请输入大学物理缺勤节数:quot);scanf(quot%dquot,amgthysics);rintf(quot\n\t\t请重新输入马克思主义基本原理与概论缺勤节数:quot);scanf(quot%dquot,amgtMks);rintf(quot\n\t\t请重新输入C语言缺勤节数:quot);scanf(quot%dquot,amgtC);rintf(quot\n\t\t请重新输入英语口语缺勤节数:quot);scanf(quot%dquot,amgtteal);rintf(quot\n\t\t请重新输入体育缺勤节数目:quot);scanf(quot%dquot,amgtPE);flag=;save(head,cla);rintf(quot\n\t\t修改成功!\n\t\tquot);eak;}=gtnext;}if(flag==){rintf(quot\t\t!!!没有这个学生信息,请核对后再输入!!!\n\nquot);}getch();system(quotclsquot);mune_();}voidcreat(void)*创建函数*{FILE*f;structStudent*head,*,*,*;charfilename[];n=;==(structStudent*)malloc(LEN);rintf(quot请输入。

5、quot);search_();}eak;case:{ch=getchar();system(quotclsquot);back();}eak;default:rintf(quot\t\t\t输入错误,请重新输入!!!quot);}rintf(quot\n\t\t\t\tquot);}ch=getchar();}voidsave(structStudent*head,charfilename[]){FILE*f;structStudent*=head;if((f=foen(filename,quotwbquot))==NULL){rintf(quotcannotoenfile\nquot);exit();}while(!=NULL){fwrite(,LEN,,f);=gtnext;}fclose(f);}structStudent*load(charfilename[]){FILE*f;structStudent*head,*,*;head=NULL;=NULL;if((f=foen(filename,quotrbquot))==NULL){rintf(quotcannotoenfile\nquot);exit();}while(!feof(f)){=(structStudent*)malloc(LEN);if(fread(,LEN,,f)==){if(head==NULL)head=;if()gtnext=;=;}}gtnext=NULL。

6、***************quot);rintf(quot\t\t\t◇********欢迎使用班级考勤系统********◇quot);rintf(quot\t\t\t********************quot);rintf(quot\n\t************************************************************\n\n\nquot);rintf(quot================================================================================quot);rintf(quot\n\n\n\t\t\t\t\n\t\t\t\t\tquot);getch();system(quotclsquot);}voidmune_(){intotion,ch;*定义一个选项的数据类型*rintf(quot\n\n\nquot);*制作的一个漂亮的选择界面*rintf(quot\t***************************************************************\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、录入本次课考勤情况\t、查询学生考勤信息\t。

7、num;}eak;case:{gtC+=num;}eak;case:{gtteal+=num;}eak;case:{gtPE+=num;}eak;}=gtnext;}rintf(quot\n\n\t\t******输入成功******!!!\nquot);rintf(quot是否继续输入(y\\n):quot);scanf(quot%cquot,amselect);}save(head,cla);getch();system(quotclsquot);mune_();}voidsearch_(void)*查询个人信息*{structStudent*head,*uot\nquot);rintf(quot\t\t\t请输入您所需的操作(~):\n\t\t\t\tquot);while(){scanf(quot%dquot,amotion);switch(otion){case:{ch=getchar();system(quotclsquot);enter();}eak;case:{ch=getchar();system(quotclsquot);search_();}eak;case:{ch=getchar();system(quotclsquot);creat();}eak;case:{ch=getchar();system(quotclsquot);modify();}eak;case:{ch=getchar();system(quotcl。

8、你要创建班级的名称(如果要创建的文件已存在,将覆盖原文件):quot);gets(filename);strcat(filename,quotdatquot);if((f=foen(filename,quotwbquot))==NULL){rintf(quotcannotoenfile\nquot);exit();}rintf(quot请输入学生的基本信息:姓名、座号、性别\nquot);scanf(quot%s%d%squot,gtname,amgtnum,gtsex);gtmath=gtEnglish=gthysics=gtMks=gtC=gtteal=gtPEtStudent*load(char[]);voidenter(void);*录入函数*voidsearch_(void);*查询函数_*voidsearch_(void);*查询函数_*voidmodify(void);*修改函数*voidback(void);*退出函数*voidmune_();*界面*voidmune_();*界面*mune_();mune_();rintf(quot\nquot);}voidmune_(){rintf(quot\n\n\n\n\n\nquot);rintf(quot\t************************************************************quot);rintf(quot\t\t\t*****。

9、\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、创建学生信息\t\t、修改学生信息\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、查看班级考勤情况\t、退出考勤系统\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t***************************************************************\nquot);rintf(q******\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、高等数学\t\t、大学英语\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、大学物理\t\t、马克思基本原理概论*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、C程序设计基础\t、教师口语\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\。

10、t\t*\nquot);rintf(quot\t*、体育\t\t\t\t\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t********************************\nquot);rintf(quot\nquot);rintf(quot\t\t\t请输入科目选项(~):\n\t\t\t\tquot);scanf(quot%dquot,amsub);while(){if(subgtamamsublt)eak;elserintf(quot\t\t\t输入错误,请重新输入\n\t\t\t\tquot);scanf(quot%dquot,amsub);}system(quotclsquot);rintf(quot请输入本次课缺席同学的座号:quot);scanf(quot%dquot,amstu);rintf(quot\nquot);rintf(quot请输入该同学的缺课节数:quot);scanf(quot%dquot,amnum);while(!=NULL){if(gtnum==stu)switch(sub){case:{gtmath+=num;}eak;case:{gtEnglish+=num;}eak;case:{gthysics+=num;}eak;case:{gtMks+=。

11、;charselect='y',cla[];intnum,flag=;rintf(quot请输入上课班级:quot);scanf(quot%squot,cla);strcat(cla,quotdatquot);=head=load(cla);rintf(quot请输入要查询同学的座号:quot);scanf(quot%dquot,amnum);system(quotclsquot);while(!=NULL){if(gtnum==num){rintf(quot\n\nquot);rintf(quot****************************************\nquot);rintf(quot座号姓名性别数学英语物理马克思C语言教师口语体育\nquot);rintf(quot%d%s%s%d%d%d%d%d%d%d\nquot,gtnum,gtname,gtsex,gtmath,gtEnglish,gthysics,gtMks,gtC,gtteal,gtPE);rintf(quot****************************************\nquot);flag=;}=gtnext;}if(flag==)rintf(quot\t\t!!!没有这个学生信息,请核对后再输入!!!\n\nquot);getch();system(quotclsquot);mune_();}voidsearch_(void 。

12、)*查询某班级信息*{charcla[];structStudent*head,*;rintf(quot请输入您要查询的班级名:quot);gets(cla);system(quotclsquot);rintf(quot\n\t\t\t%s班的考勤情况\n\nquot,cla);strcat(cla,quotdatquot);=head=load(cla);rintf(quot****************************************\nquot);rintf(quot座号姓名性别数学英语物理马克思C语言教师口语体育\nquot);while(!=NULL){rintf(quot%d%s%s%d%d%d%d%d%d%d\nquot,gtnum,gtname,gtsex,gtmath,gtEnglish,gthysics,gtMks,gtC,gtteal,gtPE);=gtnext;}rintf(quot\n****************************************\nquot);getch();system(quotclsquot);mune_();}voidmodify(void)*修改函数*{inta,flag=;charcla[];structStudent*head,*;rint=;head=NULL;while(gtnum!=){n=n+;if(n==)head=;elsegtnext=

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值