考勤管理系统c语言,C语言课程设计学生考勤系统最终版(范文1)
《C語(yǔ)言課程設(shè)計(jì)學(xué)生考勤系統(tǒng).doc》由會(huì)員分享,可免費(fèi)在線閱讀全文,更多與《C語(yǔ)言課程設(shè)計(jì)學(xué)生考勤系統(tǒng)(最終版)》相關(guān)文檔資源請(qǐng)?jiān)趲蛶臀膸?kù)(www.woc88.com)數(shù)億文檔庫(kù)存里搜索。
1、;return(head);}voidenter()*錄入函數(shù)*{structStudent*head,*;charselect='y',cla[];intsub,stu,num,flag=;rintf(quot請(qǐng)輸入上課班級(jí):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[])開(kāi)始數(shù)據(jù)寫(xiě)入文件關(guān)閉文件退出打開(kāi)文件開(kāi)始打開(kāi)文件讀出數(shù)據(jù)返回菜單結(jié)構(gòu)的應(yīng)用Ifelse結(jié)構(gòu)和while結(jié)構(gòu)嵌套結(jié)構(gòu):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。
2、quot);search_();}eak;case:{ch=getchar();system(quotclsquot);back();}eak;default:rintf(quot\t\t\t輸入錯(cuò)誤,請(qǐng)重新輸入!!!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。
3、;charselect='y',cla[];intnum,flag=;rintf(quot請(qǐng)輸入上課班級(jí):quot);scanf(quot%squot,cla);strcat(cla,quotdatquot);=head=load(cla);rintf(quot請(qǐng)輸入要查詢同學(xué)的座號(hào):quot);scanf(quot%dquot,amnum);system(quotclsquot);while(!=NULL){if(gtnum==num){rintf(quot\n\nquot);rintf(quot****************************************\nquot);rintf(quot座號(hào)姓名性別數(shù)學(xué)英語(yǔ)物理馬克思C語(yǔ)言教師口語(yǔ)體育\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!!!沒(méi)有這個(gè)學(xué)生信息,請(qǐng)核對(duì)后再輸入!!!\n\nquot);getch();system(quotclsquot);mune_();}voidsearch_(void。
4、)*查詢某班級(jí)信息*{charcla[];structStudent*head,*;rintf(quot請(qǐng)輸入您要查詢的班級(jí)名: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座號(hào)姓名性別數(shù)學(xué)英語(yǔ)物理馬克思C語(yǔ)言教師口語(yǔ)體育\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)*修改函數(shù)*{inta,flag=;charcla[];structStudent*head,*;rint=;head=NULL;while(gtnum!=){n=n+;if(n==)head=;elsegtnext=。
5、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請(qǐng)輸入科目選項(xiàng)(~):\n\t\t\t\tquot);scanf(quot%dquot,amsub);while(){if(subgtamamsublt)eak;elserintf(quot\t\t\t輸入錯(cuò)誤,請(qǐng)重新輸入\n\t\t\t\tquot);scanf(quot%dquot,amsub);}system(quotclsquot);rintf(quot請(qǐng)輸入本次課缺席同學(xué)的座號(hào):quot);scanf(quot%dquot,amstu);rintf(quot\nquot);rintf(quot請(qǐng)輸入該同學(xué)的缺課節(jié)數(shù):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+=。
6、\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、創(chuàng)建學(xué)生信息\t\t、修改學(xué)生信息\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、查看班級(jí)考勤情況\t、退出考勤系統(tǒng)\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*、高等數(shù)學(xué)\t\t、大學(xué)英語(yǔ)\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、大學(xué)物理\t\t、馬克思基本原理概論*\nquot);rintf(quot\t*\t\t\t\t\t\t\t*\nquot);rintf(quot\t*、C程序設(shè)計(jì)基礎(chǔ)\t、教師口語(yǔ)\t\t*\nquot);rintf(quot\t*\t\t\t\t\t\。
7、***************quot);rintf(quot\t\t\t◇********歡迎使用班級(jí)考勤系統(tǒng)********◇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;*定義一個(gè)選項(xiàng)的數(shù)據(jù)類型*rintf(quot\n\n\nquot);*制作的一個(gè)漂亮的選擇界面*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、查詢學(xué)生考勤信息\t。
8、:quot);scanf(quot%dquot,amgtEnglish);rintf(quot\n\t\t請(qǐng)輸入大學(xué)物理缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgthysics);rintf(quot\n\t\t請(qǐng)重新輸入馬克思主義基本原理與概論缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtMks);rintf(quot\n\t\t請(qǐng)重新輸入C語(yǔ)言缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtC);rintf(quot\n\t\t請(qǐng)重新輸入英語(yǔ)口語(yǔ)缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtteal);rintf(quot\n\t\t請(qǐng)重新輸入體育缺勤節(jié)數(shù)目: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!!!沒(méi)有這個(gè)學(xué)生信息,請(qǐng)核對(duì)后再輸入!!!\n\nquot);}getch();system(quotclsquot);mune_();}voidcreat(void)*創(chuàng)建函數(shù)*{FILE*f;structStudent*head,*,*,*;charfilename[];n=;==(structStudent*)malloc(LEN);rintf(quot請(qǐng)輸入。
9、num;}eak;case:{gtC+=num;}eak;case:{gtteal+=num;}eak;case:{gtPE+=num;}eak;}=gtnext;}rintf(quot\n\n\t\t******輸入成功******!!!\nquot);rintf(quot是否繼續(xù)輸入(y\\n):quot);scanf(quot%cquot,amselect);}save(head,cla);getch();system(quotclsquot);mune_();}voidsearch_(void)*查詢個(gè)人信息*{structStudent*head,*uot\nquot);rintf(quot\t\t\t請(qǐng)輸入您所需的操作(~):\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。
10、rite(,LEN,,f);=gtnext;}fclose(f);rintf(quot\t\t\t創(chuàng)建成功,按任意鍵返回主菜單\nquot);getch();system(quotclsquot);退出mune_();switch結(jié)構(gòu)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結(jié)構(gòu)while(!=NULL){if(gtnum==a){rintf(quot\n\t\t請(qǐng)重新輸入高等數(shù)學(xué)缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtmath);rintf(quot\n\t\t請(qǐng)重新輸入大學(xué)英語(yǔ)缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtEnglish);rintf(quot\n\t\t請(qǐng)輸入大學(xué)物理缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgthysics);rintf(quot\n\t\t請(qǐng)重新輸入馬克思主義基本原理與概論缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtMks);rintf(quot\n\t\t請(qǐng)重新輸入C語(yǔ)言缺勤節(jié)數(shù):quot);scanf(quo。
11、你要?jiǎng)?chuàng)建班級(jí)的名稱(如果要?jiǎng)?chuàng)建的文件已存在,將覆蓋原文件):quot);gets(filename);strcat(filename,quotdatquot);if((f=foen(filename,quotwbquot))==NULL){rintf(quotcannotoenfile\nquot);exit();}rintf(quot請(qǐng)輸入學(xué)生的基本信息:姓名、座號(hào)、性別\nquot);scanf(quot%s%d%squot,gtname,amgtnum,gtsex);gtmath=gtEnglish=gthysics=gtMks=gtC=gtteal=gtPEtStudent*load(char[]);voidenter(void);*錄入函數(shù)*voidsearch_(void);*查詢函數(shù)_*voidsearch_(void);*查詢函數(shù)_*voidmodify(void);*修改函數(shù)*voidback(void);*退出函數(shù)*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***** 。
12、;=;=(structStudent*)malloc(LEN);scanf(quot%s%d%squot,gtname,amgtnum,gtsex);gtmath=gtEnglish=gthysics=gtMks=gtC=gtteal=gtPE=;}gtnext=NULL;=head;while(!=NULL){fwrite(,LEN,,f);=gtnext;}fclose(f);rintf(quot\t\t\t創(chuàng)建成功,按任意鍵返回主菜單\nquot);getch();system(quotclsquot);mune_();}voidback(void)*退出函數(shù)*{rintf(quot\n\n\n\n\n\n\n\n\n\n\t\t\t\t感謝您的使用~\n\t\t\t\tquot);getch();exit();}f(quot\n\t\t請(qǐng)輸入要修改的班級(jí):quot);scanf(quot%squot,cla);strcat(cla,quotdatquot);=head=load(cla);rintf(quot\n\t\t請(qǐng)輸入要修改的學(xué)生的座號(hào):quot);scanf(quot%dquot,ama);while(!=NULL){if(gtnum==a){rintf(quot\n\t\t請(qǐng)重新輸入高等數(shù)學(xué)缺勤節(jié)數(shù):quot);scanf(quot%dquot,amgtmath);rintf(quot\n\t\t請(qǐng)重新輸入大學(xué)英語(yǔ)缺勤節(jié)
總結(jié)
以上是生活随笔為你收集整理的考勤管理系统c语言,C语言课程设计学生考勤系统最终版(范文1)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: php scsi平台,三大SCSI Ta
- 下一篇: zemax设置 像方远心_ZEMAX相机