(精品論文)c語(yǔ)言課程設(shè)計(jì)_學(xué)生成績(jī)管理系統(tǒng)_第1頁(yè)
(精品論文)c語(yǔ)言課程設(shè)計(jì)_學(xué)生成績(jī)管理系統(tǒng)_第2頁(yè)
(精品論文)c語(yǔ)言課程設(shè)計(jì)_學(xué)生成績(jī)管理系統(tǒng)_第3頁(yè)
(精品論文)c語(yǔ)言課程設(shè)計(jì)_學(xué)生成績(jī)管理系統(tǒng)_第4頁(yè)
(精品論文)c語(yǔ)言課程設(shè)計(jì)_學(xué)生成績(jī)管理系統(tǒng)_第5頁(yè)
已閱讀5頁(yè),還剩8頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

C語(yǔ)言課程設(shè)計(jì)報(bào)告:學(xué)生成績(jī)管理系統(tǒng)系統(tǒng)需求一、 當(dāng)前學(xué)生信息:通過(guò)結(jié)構(gòu)體struct student 來(lái)保存學(xué)生的姓名,學(xué)號(hào),性別,語(yǔ)文,數(shù)學(xué),英語(yǔ)和計(jì)算機(jī)等等相關(guān)信息,并且通過(guò)cin函數(shù)來(lái)進(jìn)行給當(dāng)前學(xué)生輸入初始信息. 二、學(xué)生成績(jī)查詢: 輸入一個(gè)學(xué)號(hào), 在文件中查找此學(xué)生, 若找到則輸出此學(xué)生的全部信息和成績(jī); 若找不到則輸出查找失敗的信息. 同時(shí)也可以全部把各科的平均成績(jī),最高和最低分輸出。三、新生插入 :通過(guò)給該生的學(xué)號(hào)來(lái)和原班上的學(xué)生的學(xué)號(hào)比較大小,若大就在后,若小則靠前排,將此生的信息保存下來(lái)。 四、輸出全部學(xué)生信息和全部學(xué)生成績(jī)。五、退出系統(tǒng).六、附加說(shuō)明:系統(tǒng)將來(lái)完善的功能有:可以通過(guò)性別來(lái)模糊查詢,也可以通過(guò)姓名的姓來(lái)先進(jìn)行模糊查詢,以便后面精確查找??傮w設(shè)計(jì)一、 仔細(xì)閱讀系統(tǒng)要求,首先將此系統(tǒng)化分為如下模塊(即如下函數(shù))1、輸入初始的學(xué)生信息:其中包括學(xué)生的姓名、學(xué)號(hào)和性別以及學(xué)生的語(yǔ)文、數(shù)學(xué)、英語(yǔ)和計(jì)算機(jī)等相關(guān)信息;可用函數(shù)cin(stu *p1)來(lái)實(shí)現(xiàn)此操作。 2、查詢模塊:可用stu *lookdata(stu *p1) 來(lái)實(shí)現(xiàn)。找到就輸出此學(xué)生全部信息包括學(xué)生的語(yǔ)文、數(shù)學(xué)、英語(yǔ)和計(jì)算機(jī)等的成績(jī)。 3、插入模塊:可用insert( )函數(shù)來(lái)實(shí)現(xiàn)。其中通過(guò)學(xué)號(hào)的大小來(lái)比較的,并且以此來(lái)排序。4、輸出學(xué)生的信息以及成績(jī):通過(guò)學(xué)生的姓名來(lái)查看學(xué)生的語(yǔ)文、數(shù)學(xué)、英語(yǔ)和計(jì)算機(jī)等相關(guān)成績(jī),同時(shí)也可以分別通過(guò)caverage() 、maverage() 、eaverage() 和comaverage() 來(lái)輸出語(yǔ)文、數(shù)學(xué)、英語(yǔ)和計(jì)算機(jī)等成績(jī)的平均分?jǐn)?shù)、最高和最低分?jǐn)?shù)。 5、退出系統(tǒng):可用一個(gè)函數(shù)exit()來(lái)實(shí)現(xiàn),首先將信息保存到文件中,釋放動(dòng)態(tài)創(chuàng)建的內(nèi)存空間,再退出此程序。二、系統(tǒng)主模塊結(jié)構(gòu)圖: 詳細(xì)設(shè)計(jì)一、 界面設(shè)計(jì)此系統(tǒng)界面采用圖形和數(shù)字化菜單設(shè)計(jì)。主界面設(shè)計(jì)如下: 學(xué)生成績(jī)管理系統(tǒng) 請(qǐng)選擇相應(yīng)的數(shù)字執(zhí)行相應(yīng)的功能:1:是否輸入其他數(shù)據(jù)2:查看數(shù)據(jù)3:插入數(shù)據(jù)4:查找數(shù)據(jù)5:更新數(shù)據(jù)6:保留數(shù)據(jù)7:顯示或打印數(shù)據(jù)8:語(yǔ)文成績(jī)狀況9:數(shù)學(xué)成績(jī)狀況10:英語(yǔ)成績(jī)狀況11:計(jì)算機(jī)成績(jī)狀況12:?13:退出系統(tǒng)二、 數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì): 程序設(shè)計(jì)中用到的結(jié)構(gòu)體類型: 學(xué)生信息結(jié)構(gòu)體類型:typedef struct student char nameMAX; int numMAX; char sexMAX; int chinese; int mathematic; int english; int computer; struct student *next; 程序代碼:/原始密碼是123456#includestdio.h#includestddef.h#includestddef.h#includestring.h#define MAX 10typedef struct student /*定義結(jié)構(gòu)體*/ char nameMAX; /*姓名*/ int numMAX; /* 學(xué)號(hào)*/ char sexMAX; /*性別*/ int chinese; /*語(yǔ)文*/ int mathematic; /* 數(shù)學(xué)*/ int english; /*英語(yǔ)*/ int computer; /*計(jì)算機(jī)*/ struct student *next; /*結(jié)構(gòu)體指針*/ stu;stu *head; /*頭指針*/void print() /*顯示或打印函數(shù)*/ system(cls); printf(tttScore Manage Systemn); /*成績(jī)管理系統(tǒng)*/ printf(Enter Recordt); /*輸入數(shù)據(jù)*/ printf(Displayt); /*顯示*/ printf(Insertt); /*插入數(shù)據(jù)*/ printf(Questt); /*訪問(wèn)數(shù)據(jù)*/ printf(Updatet); /*以前數(shù)據(jù)*/ printf(Savet); /*保留數(shù)據(jù)*/ printf(Fresht); /*更新數(shù)據(jù)*/ printf(Chinese Averaget); /*語(yǔ)文平均成績(jī)*/ printf(Math Averaget); /*數(shù)學(xué)平均成績(jī)*/ printf(English Averaget); /*英語(yǔ)平均成績(jī)*/ printf(Computer Averaget); /*計(jì)算機(jī)平均成績(jī)*/ printf(Quittn); /*退出*/ void cin(stu *p1) /*輸入相關(guān)數(shù)據(jù)的函數(shù)*/ printf(Enter name:n); scanf(%s,&p1-name); printf(Enter num:n); scanf(%d,&p1-num); printf(Enter sex:n); scanf(%s,&p1-sex); printf(Enter score:n); printf(Enter chinese:n); scanf(%d,&p1-chinese); printf(Enter math:n); scanf(%d,&p1-mathematic); printf(Enter English:n); scanf(%d,&p1-english); printf(Enter Computer:n); scanf(%d,&p1-computer); stu *cindata() /*其他數(shù)據(jù)是否繼續(xù)輸入的函數(shù)*/ stu *p1,*p2; int i=1; char ch; p1=(stu *)malloc(sizeof(stu); head=p1; while(i) cin(p1); printf(Do you Want to Continue?yes or no); /*是否繼續(xù)輸入數(shù)據(jù)*/ ch=getchar(); ch=getchar(); if(ch=n|ch=N) i=0; p1-next=NULL; else p2=p1; p1=(stu *)malloc(sizeof(stu); p2-next=p1; return(p1-next);stu *lookdata(stu *p1) /*查看數(shù)據(jù)的函數(shù)*/ while(p1!=NULL) printf(Num:%dt,p1-num); printf(Name:%st,p1-name); printf(Sex:%st,p1-sex); printf(n); printf(Chinese:%dt,p1-chinese); printf(Math:%dt,p1-mathematic); printf(English:%dt,p1-english); printf(Computer:%dt,p1-computer); printf(n); p1=p1-next; return p1; void insert() /*通過(guò)比較學(xué)號(hào)來(lái)插入數(shù)據(jù)的函數(shù)*/ stu *p1,*p3,*p2; char ch; p1=head; p3=(stu *)malloc(sizeof(stu); p3-next=NULL; if(head=NULL) head=p3; return; cin(p3); while(p1!=NULL&(p1-numnum) /*通過(guò)學(xué)號(hào)的比較來(lái)插入*/ p2=p1;p1=p1-next; if(p2=head) p3-next=head; head=p3; return; p3-next=p1; p2-next=p3; find(stu *p2) /*通過(guò)姓名查找查看數(shù)據(jù)的函數(shù)*/ char name20; int b=0; printf(Enter the name of the student you want to find:); /*通過(guò)姓名查看*/ scanf(%s,name); while(p2!=NULL) if(strcmp(name,p2-name)=0) printf(The data you want has be foundn); printf( Name:%st,p2-name); printf(Num:%dt,p2-num); printf(sex%st,p2-sex); printf(n); printf(Chinese:%dt,p2-chinese); printf(Math:%dt,p2-mathematic); printf(English:%dt,p2-english); printf(Computer:%dt,p2-computer); printf(n); b=1; else if(b=0) printf(sorry not find data!); p2=p2-next; if(b=1) print(); printf(Find onen); else print(); printf(Not findn); void caverage() /*求各學(xué)生語(yǔ)文平均分、最高和最低分成績(jī)的函數(shù)*/ stu *p1; int i; float max=0.0,min=200.0; float sum=0.0,aver=0; p1=head; if(p1=NULL) printf(not data!); else for(i=0;p1!=NULL;i+,p1=p1-next) sum+=p1-chinese; aver=sum/i; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(maxchinese) max=p1-chinese; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(minp1-chinese) min=p1-chinese; printf(Chinese Average:%f,aver); printf(Chinese Max:%f,max); printf(Chinese Min:%f,min); void maverage() /*求各學(xué)生數(shù)學(xué)平均分、最高和最低分成績(jī)的函數(shù)*/ stu *p1; int i; float max=0.0,min=200.0; float sum=0.0,aver=0; p1=head; if(p1=NULL) printf(not data!); else for(i=0;p1!=NULL;i+,p1=p1-next) sum+=p1-mathematic; aver=sum/i; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(maxmathematic) max=p1-mathematic; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(minp1-mathematic) min=p1-mathematic; printf(Mathe Average:%f,aver); printf(Mathe Max:%f,max); printf(Mathe Min:%f,min); void eaverage() /*求各學(xué)生英語(yǔ)平均分、最高和最低分成績(jī)的函數(shù)*/ stu *p1; int i; float max=0.0,min=200.0; float sum=0.0,aver=0; p1=head; if(p1=NULL) printf(not data!); else for(i=0;p1!=NULL;i+,p1=p1-next) sum+=p1-english; aver=sum/i; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(maxenglish) max=p1-english; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(minp1-english) min=p1-english; printf(English Average:%f,aver); printf(English Max:%f,max); printf(English Min:%f,min); void comaverage() /*求各學(xué)生計(jì)算機(jī)平均分、最高和最低分成績(jī)的函數(shù)*/ stu *p1; int i; float max=0.0,min=200.0; float sum=0.0,aver=0; p1=head; if(p1=NULL) printf(not data!); else for(i=0;p1!=NULL;i+,p1=p1-next) sum+=p1-computer; aver=sum/i; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(maxcomputer) max=p1-computer; p1=head; for(i=0;p1!=NULL;i+,p1=p1-next) if(minp1-computer) min=p1-computer; printf(Computer Average:%f,aver); printf(Computer Max:%f,max); printf(Computer Min:%f,min); update(stu *p2) /*通過(guò)姓名查找來(lái)更新數(shù)據(jù)*/ char name10; /*p2為指向結(jié)構(gòu)體struct student的指針*/ int b=0; printf(Enter The Name); /*輸入姓名*/ scanf(%s,name); while(p2!=NULL) if(strcmp(name,p2-name)=0) printf(Find you datan); scanf(Name:%s,p2-name); scanf(Num:%s,p2-num); scanf(Sex:%s,p2-sex); scanf(Chinese:%d,p2-chinese); scanf(Math:%d,p2-mathematic); scanf(english:%d,p2-english); scanf(Computer:%d,p2-computer); printf(Success!); b=1; else if(b=0) printf(Sorry not Find data!); p2=p2-next; if(b=0) print(); printf(Sorry not Find data!); else print(); printf(Finish!); save(stu *p2) /*保留數(shù)據(jù)函數(shù)*/ FILE *fp; char file10; printf(Enter file name); /*輸入文件名*/ scanf(%s,file); fp=fopen(file,w); while(p2!=NULL) fprintf(fp,%s,p2-name); fprintf(fp,%s,p2-num); fprintf(fp,%s,p2-sex); fprintf(fp,%d,p2-chinese); fprintf(fp,%d,p2-mathematic); fprintf(fp,%d,p2-english); fprintf(fp,%d,p2-computer); p2=p2-next; fclose(fp); char password7=123456; /*定義初始密碼*/void main() /*主函數(shù)*/ int choice; stu *p2; char s8; int flag=0,i; /*標(biāo)志項(xiàng)*/ int n=3; do printf(Enter password:n); scanf(%s,s); if(!strcmp(s,password) /*進(jìn)行密碼匹配驗(yàn)證*/ printf(PASSnnn); flag=1; break; else printf(Error Enter again:n); n-; while(n0); if(!flag) printf(you have Enter 3 times!); /*輸入密碼超過(guò)了3次!*/ exit(0); /*自動(dòng)退出*/ /*密碼驗(yàn)證成功后進(jìn)入的界面*/ printf(tttn); /*操作界面*/ printf(ttWelcom to the Misn); printf(Author:-tClass:-tNum:-n); /*作者,班級(jí)和號(hào)碼*/ printf(Adress:HGn); /*地址*/ printf(%n); printf(ttEnter OP:n); printf(nnnn); printf(=tt=n); printf(=tt=n); printf(ttEnter the MIS yes or non); /*問(wèn)進(jìn)入系統(tǒng)與否*/ scanf(%d,&choice); if(choice=n|choice=N) exit(1); print(); while(1) printf(Enter choice:); scanf(%d,&i); if(i13) printf(Enter num from 1 to 13:n); /*再?gòu)?-13中進(jìn)行選擇*/ exit(1); switch(i) case 1: p2=cindata(); /*其他數(shù)據(jù)是否繼續(xù)輸入的函數(shù)*/ break; case 2: p2=lookdata(head); /*查看數(shù)據(jù)的函數(shù)*/ break; case 3: insert(); /*通過(guò)比較學(xué)號(hào)來(lái)插入數(shù)據(jù)的函數(shù)*/ break; case 4: find(head); /*通過(guò)姓名查找查看數(shù)據(jù)的函數(shù)*/ break; case 5: update(head); /*通過(guò)姓名查找來(lái)更新數(shù)據(jù)*/ break; case 6: save(head); /*保留數(shù)據(jù)函數(shù)*/ break; case 7: print(); /*顯示或打印函數(shù)*/ break; case 8: caverage(); /*求各學(xué)生語(yǔ)文平均分、最高和最低分成績(jī)的函數(shù)*/ break; case 9: maverage(); /*求各學(xué)生數(shù)學(xué)平均分、最高和最低分成績(jī)的函數(shù)*/ break; case 10: eaverage(); /*求各學(xué)生英語(yǔ)平均分、最高和最低分成

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論