![C語言學生成績管理系統(tǒng)課程設計報告_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/27/44459ac9-eb03-4bee-9b45-e5df91dfc3ea/44459ac9-eb03-4bee-9b45-e5df91dfc3ea1.gif)
![C語言學生成績管理系統(tǒng)課程設計報告_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/27/44459ac9-eb03-4bee-9b45-e5df91dfc3ea/44459ac9-eb03-4bee-9b45-e5df91dfc3ea2.gif)
![C語言學生成績管理系統(tǒng)課程設計報告_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/27/44459ac9-eb03-4bee-9b45-e5df91dfc3ea/44459ac9-eb03-4bee-9b45-e5df91dfc3ea3.gif)
![C語言學生成績管理系統(tǒng)課程設計報告_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/27/44459ac9-eb03-4bee-9b45-e5df91dfc3ea/44459ac9-eb03-4bee-9b45-e5df91dfc3ea4.gif)
![C語言學生成績管理系統(tǒng)課程設計報告_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-2/27/44459ac9-eb03-4bee-9b45-e5df91dfc3ea/44459ac9-eb03-4bee-9b45-e5df91dfc3ea5.gif)
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、C語言課程設計報告1 .問題描述:題目七:學生成績管理系統(tǒng)設計學生成績信息包括:學期,學號,班別,姓名,四門課程成績(語文、數(shù)學、英語和計算機 )等。主要功能:(1)能按學期、按班級完成對學生成績的錄入、修改(2)能按班級統(tǒng)計學生的成績,求學生的總分及平均分(3)能查詢學生成績,不及格科目及學生名單(4)能按班級輸出學生的成績單要求:使用二進制文件方式存儲數(shù)據(jù),系統(tǒng)以菜單方式工作學生成績信息包括:學期,學號,班別,姓名,四門課程成績(語文、數(shù)學、英語和計算機 )等。要求使用二進制文件方式存儲數(shù)據(jù),系統(tǒng)以菜單方式工作,實現(xiàn)對學生成績的錄入,修改,統(tǒng)計,排序, 查詢,輸出等功能。2 .設計目的設計
2、“學生成績管理系統(tǒng)”使其具有以下功能:11)能完成對學生成績的錄入(2)能按班級統(tǒng)計學生的成績,求學生的總分及平均分,排序(3)能按班級,學期輸出學生的成績單和不及格科目及學生名單(4)能查詢單個學生成績(5)能修改單個學生信息3 .要求系統(tǒng)以菜單方式工作4 .功能1輸入功能:可以一次完成無數(shù)條信息的輸入。2輸出功能:能按班級輸出學生的成績單。3修改功能:完成對單個學生成績的修改。4查找功能:完成對單個學生信息查找,并顯示。5排序功能:按學生成績進行排序,并顯示。6有一個清晰美觀界面來調(diào)用各個功能五.模塊圖結構數(shù)組struct student學期 int term班級 int classes姓
3、名 char name10學號int num成績 int score4信息錄入void input學號 stui.num 、班級 stui.classes ,姓名 、四門課成績 stui.score成績統(tǒng)計void sort按班級統(tǒng)計學生的成績,求學生的總分及平均分,排序成績輸出能按班級,學期輸出學生成績單和不及格科目及學生名單void print能按學號查詢單個學生成績修改單個學生信息void六.詳細內(nèi)容monify整個系統(tǒng)除了主函數(shù)外,另外還有5個函數(shù),實現(xiàn)六大功能:輸入功能、輸出功能、修改功能,查找并顯示功能、排序并顯示功能。各個函數(shù)的詳細設計說明分別如下:1 .定義
4、結構體及宏定義#include <stdlib.h>#include <stdio.h>#include <string.h>#define NUM 100 struct student int term;int num;int classes;char name10;int score4;int sum;float average;stuNUM;2.主函數(shù) main()利用無限次循環(huán)for(;)和swithch()進行菜單選擇來實現(xiàn)各函數(shù)的調(diào)用,系統(tǒng)根據(jù)輸入的數(shù)字選項來調(diào) 用相應的函數(shù)。等執(zhí)行完每一個函數(shù)功能后,按任一鍵回到主界面也要通過這個函數(shù)來實現(xiàn)!v
5、oid main()zcd();/*主函數(shù)界面*/void zcd()int n=0;char m;system("cls");/* 清屏 */printf("按任一鍵進入主菜單n "); /*按任一鍵進入主菜單*/printf("*n");printf("tt華中科技大學文華學院歡迎您n");printf("nttt歡迎使用學生管理系統(tǒng)nntttttAn");printf(" * *MENU * *n");printf("ttt1.printf("ttt
6、2.printf("ttt3.printf("ttt4.printf("ttt5.輸入學生成績記錄 Input the record'n"); /* 排序并顯示 Sort to make new a file'n"); /* 按班級顯示成績單 Print the record'n"); /*輸入學生成績記錄*/排序*/顯示*/printf("ttt6.查找個人成績Search record on name'n"); /* 查找 */修改 Modify a record'n&q
7、uot;); /* 修改 */退出 Quit'n"); /* 退出 */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();break; case '3':print();system("p
8、ause");break;case '4':search();zcd();break;case '5':modify();system("pause");zcd();break;case '6':exit(0); /*如菜單返回值為7則程序結束*/default:printf("錯誤命令");getchar();zcd(); while(1);3輸入信息函數(shù)void input()system("cls");int i;char a;for(i=0;i<NUM;i+) p
9、rintf(" 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
10、請輸入學生的i文成績:");scanf("%d",&stui.score0);printf("n請輸入學生的數(shù)學成績:");scanf("%d", &stui.score1);printf("n請輸入學生的英語成績:");scanf("%d", &stui.score2);printf("n請輸入學生的計算機成績:");scanf("%d", &stui.score3);stui.sum=stui.score0+s
11、tui.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;4、排序并顯示函數(shù)void sort()int i,j=0;float temp;for(i=0;i<NUM;i+) stui.sum=stui.score0+stui.score1+stui.score2+stui.score3;stu
12、i.average=(float)stui.sum/4.0;for(i=0;i<NUM-1;i+)for(j=i+1;j<NUM;j+)if(stui.sum<stuj.sum)temp=stui.sum;stui.sum=stuj.sum;stuj.sum=temp; ? printf("學號t姓名t班級語文數(shù)學英語計算機總分平均分n");for(i=0;i<NUM;i+)printf("%dt%st%d%5d%5d%5d%6d%7d%8.2fn",stui.num,,stui.classes,stui.sco
13、re0,stui.score1,stui.score2,stui.score3,stui.sum,stui.average);/*輸出學生信息*/system("pause");system("cls");print();?5查找并顯示一個記錄void search() system("cls");/* 清屏 */int number=0,i;printf("ttt請輸入要查找學生的學號:");scanf("%d",&number);printf("學號t姓名t班級語文數(shù)學英語
14、計算機總分平均分n");for(i=0;i<NUM;i+)if(number=stui.num) break;/* 查找判斷 */ if(i<NUM)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); /*輸出學生信息*/elseprintf("沒找到該學生的信息n");system("pa
15、use");6.按學期、按班級輸由成績函數(shù)void print()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 print1()/ 按學期i
16、nt i,m;printf("請輸入學期:n");scanf("%d",&m);printf("學號t姓名t班級語文數(shù)學英語計算機總分平均分n");for(i=0;i<NUM;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.averag
17、e); /*/system("pause");system("cls");print();void print2()/ 按班級int i,j,k;printf("請輸入班級:n");scanf("%d",&k);printf("學號t姓名t班級 語文 數(shù)學 英語 計算機 總分 平均分n");for(i=0;i<NUM;i+)if(k=stui.classes) stui.sum=stui.score0+stui.score1+stui.score2+stui.score3;stui
18、.average=stui.sum/4.0;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); /*輸出學生信 息*/printf("輸出不及格學生名單及成績:n");printf("學號t姓名t班級語文數(shù)學英語計算機n");for(i=0;i<NUM;i+)for(j=0;j<4;j+)i
19、f(stui.scorej<60&&k=stui.classes)/* 輸出不及格學生名單及成績*/printf("%dt%st%d%5d%5d%5d%6dn",stui.num,,stui.classes, stui.score0,stui.score1,stui.score2, stui.score3);break;system("pause");system("cls");print();7修改成績函數(shù)void modify() system("cls");int nu
20、mber,i;printf("ttt請輸入要修改信息J勺學生學號:");scanf("ttt%d",&number);for(i=0;i<NUM;i+)if(number=stui.num) break;/* 查找判斷 */if(i<NUM)/* 查找判斷 */ printf("請輸入修改后的學生的信息:");printf(" n請輸入學生的學期:");scanf("%d",&stui.term);printf(" n請輸入學生的學號:");ffl
21、ush(stdin);scanf("%d",&stui.num);printf(" n請輸入學生的班級:");scanf("%d",&stui.classes);printf("n請輸入學生的姓名:");scanf("%s", );printf("n請輸入學生的i文成績:");scanf("%d",&stui.score0);printf("n請輸入學生的數(shù)學成績:");scanf("%d", &stui.score1);printf("n請輸入學生的英語成績:");scanf("%d", &stui.score2);printf("n請輸入學生的計算機成績:");scanf("%d", &stui.score3);elseprintf("沒找到該學生的信息n");system(&qu
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- ERK2-IN-5-生命科學試劑-MCE-2561
- 二零二五年度文化旅游項目管理費合同范本
- 二零二五年度體育賽事表演安全免責合同
- 施工日志填寫樣本建筑物綠化工程
- 小學數(shù)學課堂中的情境教學與興趣培養(yǎng)
- 酒店衛(wèi)生標準與旅客健康保障措施研究
- 個人土地承包合同示范文本
- 產(chǎn)品分銷區(qū)域合同范本
- SPA會所年度承包經(jīng)營合同
- 個人財產(chǎn)保險合同模板(經(jīng)典)
- GB 21258-2024燃煤發(fā)電機組單位產(chǎn)品能源消耗限額
- 2024年全國各地中考試題分類匯編:古詩詞閱讀
- 2024年全國執(zhí)業(yè)獸醫(yī)考試真題及答案解析
- 農(nóng)產(chǎn)品質(zhì)量評估與分級
- 社區(qū)成人血脂管理中國專家共識(2024年)
- 信息科技重大版 七年級上冊 互聯(lián)網(wǎng)應用與創(chuàng)新 第1單元 單元教學設計 互聯(lián)網(wǎng)時代
- CR200J動力集中動車組拖車制動系統(tǒng)講解
- 骨盆骨折患者的護理
- 國際貨物運輸委托代理合同(中英文對照)全套
- 全面新編部編版四年級下冊語文教材解讀分析
- 江蘇農(nóng)牧科技職業(yè)學院單招《職業(yè)技能測試》參考試題庫(含答案)
評論
0/150
提交評論