




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、.沈陽師范大學科信軟件學院小學期課程設計報告課題名稱: 學生成績管理系統(tǒng)設計 姓 名: 楊先勇 學 號: 12008065 專業(yè)年級: 2012級軟件工程2班 指導教師: 張麗娜 2014年6月26日課程設計報告:學生成績管理系統(tǒng)設計 編程語言:C一、 系統(tǒng)需求學生成績信息包括:學期,學號,班別,姓名,四門課程成績(語文、數(shù)學、英語和計算機)等。主要功能:(1) 能按學期、按班級完成對學生成績的錄入、修改(2) 能按班級統(tǒng)計學生的成績,求學生的總分及平均分(3) 能查詢學生成績,不及格科目及學生名單(4) 能按班級輸出學生的成績單 二、 要求使用二進制文件方式存儲數(shù)據(jù),系統(tǒng)以菜單方式工作三、
2、設計目的(1) 能完成對學生成績的錄入(2) 能按班級統(tǒng)計學生的成績,求學生的總分及平均分,排序(3) 能按班級,學期輸出學生的成績單和不及格科目及學生名單(4) 能查詢單個學生成績(5) 能修改單個學生信息四、 結(jié)構(gòu)圖修改單個學生信息修 改void monify結(jié)構(gòu)圖班級int classes學期int term信息錄入void input 成績統(tǒng)計void sort查詢 void search姓名char name10學號int num成績int score4學號stui.num、班級stui.classes,姓名、四門課成績stui.score能按學號查詢單個學生成績
3、按班級統(tǒng)計學生的成績,求學生的總分及平均分,排序成績輸出void print能按班級,學期輸出學生成績單和不及格科目及學生名單結(jié)構(gòu)數(shù)組struct student五、 程序代碼#include /*定義結(jié)構(gòu)體*/#include #include #define NUM 100struct student int term; int num; int classes; char name10; int score4; int sum; double average; stuNUM;void print1();void print2();void zcd(); void input() /*輸入
4、信息函數(shù)*/ system(cls); int i;char a;for(i=0;iNUM;i+) printf( n請輸入學生的學期:); scanf(%d,&stui.term); printf( n請輸入學生的學號:); fflush(stdin); scanf(%d,&stui.num); printf( n請輸入學生的班級:); scanf(%d,&stui.classes); printf(n請輸入學生的姓名:); scanf(%s, ) ; printf(n請輸入學生的語文成績:); scanf(%d,&stui.score0); printf(n請輸入學生的數(shù)
5、學成績:); scanf(%d, &stui.score1); printf(n請輸入學生的英語成績:); scanf(%d, &stui.score2); printf(n請輸入學生的計算機成績:); scanf(%d, &stui.score3); stui.sum=stui.score0+stui.score1+stui.score2+stui.score3;/算總分和平均 stui.average=(float)stui.sum/4.0; printf(是否要繼續(xù)添加(按N&n退出); fflush(stdin); a=getchar(); if(a=n|a=N) break;void
6、 search() /*查找并顯示一個記錄*/ system(cls);/*清屏*/ int number=0,i; printf(ttt 請輸入要查找學生的學號:); scanf(%d,&number); printf(學號t姓名t班級 語文 數(shù)學 英語 計算機 總分 平均分n); for(i=0;iNUM;i+) if(number=stui.num) break;/*查找判斷*/ if(iNUM)printf(%dt%st%d%5d%5d%5d%6d%7d%8.2fn,stui.num,,stui.classes,stui.score0,stui.score1,stui
7、.score2, stui.score3,stui.sum,stui.average); /*輸出學生信息*/ elseprintf(沒找到該學生的信息n);system(pause); void print() /*按學期、按班級輸出成績函數(shù)*/ system(cls);char a; printf(1、按學期輸出n);printf(2、按班級輸出n);printf(3、返回n);fflush(stdin);a=getchar();switch(a)case 1:print1();case 2:print2();case 3:zcd();default:print(); void print
8、1()/按學期int i,m;printf(請輸入學期:n);scanf(%d,&m);printf(學號t姓名t班級 語文 數(shù)學 英語 計算機 總分 平均分n);for(i=0;iNUM;i+) if(m=stui.term) printf(%dt%st%d%5d%5d%5d%6d%7d%8.2fn,stui.num,,stui.classes, stui.score0,stui.score1,stui.score2, stui.score3,stui.sum,stui.average); /*輸出學生信息*/system(pause);system(cls);print(
9、);void print2()/按班級int i,j,k;printf(請輸入班級:n);scanf(%d,&k); printf(學號t姓名t班級 語文 數(shù)學 英語 計算機 總分 平均分n);for(i=0;iNUM;i+) if(k=stui.classes) stui.sum=stui.score0+stui.score1+stui.score2+stui.score3; stui.average=stui.sum/4.0; printf(%dt%st%d%5d%5d%5d%6d%7d%8.2fn,stui.num,,stui.classes, stui.score0,
10、stui.score1,stui.score2, stui.score3,stui.sum,stui.average); /*輸出學生信息*/ printf(輸出不及格學生名單及成績:n);printf(學號t姓名t班級 語文 數(shù)學 英語 計算機 n);for(i=0;iNUM;i+) for(j=0;j4;j+) if(stui.scorej60&k=stui.classes) /*輸出不及格學生名單及成績*/ printf(%dt%st%d%5d%5d%5d%6dn,stui.num,,stui.classes, stui.score0,stui.score1,stui.
11、score2, stui.score3); break; system(pause);system(cls);print();void modify() /*修改成績函數(shù)*/ system(cls); int number,i; printf(ttt請輸入要修改信息的學生學號:); scanf(ttt%d,&number); for(i=0;iNUM;i+) if(number=stui.num) break;/*查找判斷*/ if(iNUM)/*查找判斷*/ printf(請輸入修改后的學生的信息:); printf( n請輸入學生的學期:); scanf(%d,&stui.term); p
12、rintf( n請輸入學生的學號:); fflush(stdin); scanf(%d,&stui.num); printf( n請輸入學生的班級:); scanf(%d,&stui.classes); printf(n請輸入學生的姓名:); scanf(%s, ) ; printf(n請輸入學生的語文成績:); scanf(%d,&stui.score0); printf(n請輸入學生的數(shù)學成績:); scanf(%d, &stui.score1); printf(n請輸入學生的英語成績:); scanf(%d, &stui.score2); printf(n請輸入學生的計
13、算機成績:); scanf(%d, &stui.score3); elseprintf(沒找到該學生的信息n);system(paues);system(cls);zcd();void sort() /*排序并顯示函數(shù)*/ int i,j=0;int temp; for(i=0;iNUM;i+) stui.sum=stui.score0+stui.score1+stui.score2+stui.score3; stui.average=(float)stui.sum/4.0; for(i=0;iNUM-1;i+)for(j=i+1;jNUM;j+)if(stui.sumstuj.sum)tem
14、p=stui.sum; stui.sum=stuj.sum; stuj.sum=temp; printf(學號t姓名t班級 語文 數(shù)學 英語 計算機 總分 平均分n); for(i=0;iNUM;i+) printf(%dt%st%d%5d%5d%5d%6d%7d%8.2fn,stui.num,,stui.classes, stui.score0,stui.score1,stui.score2,stui.score3,stui.sum,stui.average); /*輸出學生信息*/system(pause);system(cls);print(); void zcd()i
15、nt n=0;char m;system(cls);/*清屏*/ printf(按任一鍵進入主菜單n ); /*按任意鍵進入主菜單*/ printf(*n); printf(tt沈陽師范大學軟件學院歡迎您n); printf(nttt- 歡迎您使用學生管理系統(tǒng)nnttttt-n); printf(*MENU*n); printf(ttt1. 輸入學生成績記錄 Input the recordn); /*輸入學生成績記錄*/ printf(ttt2. 排序并顯示 Sort to make new a filen); /*排序*/ printf(ttt3. 按班級顯示成績單 Print the r
16、ecordn); /*顯示*/ printf(ttt4. 查找個人成績 Search record on namen); /*查找*/ printf(ttt5. 修改 Modify a recordn); /*修改*/ printf(ttt6. 退出 Quitn); /*退出*/ printf(*n); printf(nttt輸入你的選擇Enter your choice(17):); fflush(stdin); m=getchar(); doswitch(m) case 1:input();zcd();break; case 2:sort();system(pause);zcd();bre
17、ak; case 3:print();system(pause);break; case 4:search();zcd();break; case 5:modify();system(pause);zcd();break; case 6:exit(0); /*如菜單返回值為7則程序結(jié)束*/ default:printf(錯誤命令); getchar();zcd(); while(1); void main() zcd(); 六、 調(diào)試與運行 主菜單 成績錄入 統(tǒng)計排序 輸出成績學號 姓名 班級 語文 數(shù)學 英語 計算機 總分 平均分2 2 2 22 22 22 2 68 178 8 8 8 9
18、 9 9 35 8.750 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.000 0 0 0 0 0 0 0 0.00 查找 修改請輸入要修改信息的學生學號:02請輸入修改后的學生的信息請輸入學生的學期:2請輸入學生的學號:34請輸入學生的班級:3請輸入學生的姓名:yangyong請輸入學生的語文成績:45請輸入學生的數(shù)學成績:56請輸入學生的英語成績:78請輸入學生的計算機成績:66 七、 設計總結(jié)經(jīng)過
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 設備投資計劃
- 建筑規(guī)劃保安工作計劃
- 航空領域保安工作的創(chuàng)新計劃
- 會計信息與決策的關系探討計劃
- 2025年媒體經(jīng)營項目建議書
- 2025年中國夜游經(jīng)濟行業(yè)供需態(tài)勢、競爭格局及投資前景分析報告(智研咨詢)
- 2025年超硬材料項目合作計劃書
- 2025年特種大型鋁合金型材項目發(fā)展計劃
- 構(gòu)建直觀易用的用戶操作面板
- 2025年子宮收縮藥項目發(fā)展計劃
- 《發(fā)展?jié)h語(第二版)中級綜合(Ⅰ)》第11課+課件
- 醫(yī)師簽名(簽章)留樣備案表
- 0~6歲兒童眼保健和視力檢查標準技術(shù)操作
- 新會中集:集裝箱ISO尺寸要求
- 項目7選購機箱和atx電源學習資料
- 實施鄉(xiāng)村振興戰(zhàn)略要求鞏固和完善農(nóng)村基本經(jīng)營制度
- 護士長護理管理質(zhì)量評價表
- ISO45001職業(yè)健康安全管理體系培訓
- 骨科檢查法檢查要點
- 漢語言文學論文6000字
- 電子商務概論-課件
評論
0/150
提交評論