【正文】
C語(yǔ)言課程設(shè)計(jì)報(bào)告題 目 學(xué)生成績(jī)管理系統(tǒng) 學(xué) 院__計(jì)算機(jī)學(xué)院__專 業(yè)_計(jì)算機(jī)科學(xué)與技術(shù)_年級(jí)班別___09級(jí)計(jì)科一班___學(xué) 號(hào)__ 3109005882 _學(xué)生姓名______黃杰 ___指導(dǎo)教師___謝光強(qiáng)_______ 成 績(jī) 程序功能完成情況測(cè)試用例全面情況報(bào)告格式是否與要求相符報(bào)告內(nèi)容是否準(zhǔn)確全面2010年 1 月 設(shè)計(jì)一個(gè)學(xué)生成績(jī)管理系統(tǒng),對(duì)上學(xué)期的本班的學(xué)習(xí)成績(jī)進(jìn)行管理,具有查詢和檢索功能,并且能夠?qū)χ付ㄎ募僮?,也可將多個(gè)文件組成一個(gè)文件。A、 設(shè)計(jì)內(nèi)容每一條記錄包括一個(gè)學(xué)生的學(xué)號(hào)、姓名、性別、各門課成績(jī)(上學(xué)期的科目)、平均成績(jī)。輸入功能:可以一次完成若干條記錄的輸入。顯示功能:完成全部學(xué)生記錄的顯示。查找功能:完成按姓名或?qū)W號(hào)查找學(xué)生記錄,并顯示。排序功能:按學(xué)生平均成績(jī)進(jìn)行排序。插入功能:按學(xué)號(hào)順序插入一條學(xué)生記錄。應(yīng)提供一個(gè)界面來(lái)調(diào)用各個(gè)功能,調(diào)用界面和各個(gè)功能的操作界面應(yīng)盡可能清晰美觀!B、 設(shè)計(jì)要求一、 已知有存儲(chǔ)本班學(xué)生記錄(包括學(xué)號(hào)、姓名、科目成績(jī)、性別、),所有學(xué)生以學(xué)號(hào)從小到大排序(該文件自行建立)。要求編程序?qū)崿F(xiàn)查詢、排序、插入、刪除諸功能。具體要求如下:A.要求顯示如下界面****************************************1查詢2排序3插入4刪除****************************************通過選擇14來(lái)確定要做哪一個(gè)操作。B.若選1,則出現(xiàn)如下界面********************************************************************************,其中:按姓名查詢用順序法實(shí)現(xiàn);按成績(jī)查詢實(shí)現(xiàn)查詢成績(jī)小于m分的學(xué)生;找到該生將學(xué)生記錄輸出到屏幕,若查無(wú)此人,輸出相關(guān)信息。C.若選2,則按成績(jī)從大到小排序,姓名,學(xué)號(hào)順序也隨之調(diào)整。D.若選3,將一個(gè)新學(xué)生記錄按學(xué)號(hào)順序插入。E.若選4,刪除指定學(xué)生的記錄。G.不同的模塊都要有出錯(cuò)處理,并能給出出錯(cuò)提示。如輸入數(shù)據(jù)錯(cuò)誤,文件操作錯(cuò)誤等等F.以上各個(gè)功能均編寫成子函數(shù),由主函數(shù)調(diào)用實(shí)現(xiàn)。G.利用結(jié)構(gòu)體數(shù)組實(shí)現(xiàn)學(xué)生成績(jī)的數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì);模塊:學(xué)生成績(jī)管理系統(tǒng)查詢模塊排序模塊顯示模塊保存模塊刪除模塊插入模塊結(jié)束顯示返回插入返回選擇返回保存返回按學(xué)號(hào)查詢按學(xué)號(hào)選擇刪除按姓名選擇刪除返回主菜單按姓名查詢按成績(jī)查詢排序返回?cái)?shù)學(xué)平均分英語(yǔ)C語(yǔ)言健康教育返回計(jì)算機(jī)歷史程序結(jié)構(gòu)圖:main:int flag=1。 struct student *head=NULL。 head=load()。Doswitch(menu())case 39。039。:flag=0。break。case 39。139。:search(head)。break。case 39。239。:sort(head)。break。case 39。339。:head==NULL?head=insert(head):insert(head)。 save(head)。 break。case 39。439。:head=delete(head)。save(head)。break。case 39。539。:save(head)。printf(It39。s saved!)。getch()。break。case 39。639。: clrscr()。formhead()。print(head)。break。while(flag)frees(head)。int menu()。char ch。textmode(C80)。textbackground(BLUE)。textcolor(YELLOW)。clrscr()。gotoxy(20,3)。cprintf(Students39。 performance management system)。gotoxy(20,6)。cprintf(****************************************)。gotoxy(30,8)。 cprintf(1Search。)。gotoxy(30,10)。 cprintf(2Sort。)。gotoxy(30,12)。 cprintf(3Insert。)。gotoxy(30,14)。 cprintf(4Delete。)。gotoxy(30,16)。 cprintf(5Save in file。)。gotoxy(30,18)。 cprintf(6Display。)。gotoxy(30,20)。 cprintf(0Exit。)。gotoxy(20,22)。 cprintf(****************************************)。gotoxy(1,25)。 cprintf(please press the number you choose:)。ch=getchar()。return ch。int menu2()。char ch。textmode(C80)。textbackground(BLUE)。textcolor(YELLOW)。clrscr()。gotoxy(34,5)。 cprintf(Query menu)。gotoxy(20,8)。 cprintf(****************************************)。gotoxy(25,10)。 cprintf(1search by ID number。)。gotoxy(25,12)。 cprintf(2search by name。)。gotoxy(25,14)。 cprintf(3search by score。)。gotoxy(25,16)。 cprintf(0Return to main menu。)。gotoxy(20,20)。 cprintf(****************************************)。gotoxy(1,25)。 cprintf(please press the number you choose:)。ch=getchar()。return ch。int menu3()。char ch。textmode(C80)。textbackground(BLUE)。textcolor(YELLOW)。clrscr()。clrscr()。gotoxy(20,3)。 cprintf(Enter the number of subjects to check)。gotoxy(20,6)。 cprintf(****************************************)。gotoxy(25,8)。cprintf(1Math。)。gotoxy(25,9)。 cprintf(2English。)。gotoxy(25,10)。 cprintf(3C Program。)。gotoxy(25,11)。cprintf(4Computer。)。gotoxy(25,12)。cprintf(5Health Education。)。gotoxy(25,13)。cprintf(6History。)。gotoxy(25,14)。cprintf(7average。)。gotoxy(25,15)。cprintf(0Return to previous menu。)。gotoxy(20,18)。 cprintf(****************************************)。gotoxy(1,25)。 cprintf(please press the number you choose:)。ch=getchar()。return ch。void search(struct student *head)。int flag=1。 while(flag)switch(menu2())case 49:search1(head)。break。case 50:search2(head)。break。case 51:search3(head)。break。case 48:flag=0。break。void search1(struct student *)。struct student *p。int none=1。char number[11]。p=head。clrscr()。printf(please in put a student39。s number:)。scanf(%s,number)。 直到確認(rèn)printf(Search results:\n)。formhead()。 while(p!=0)NY (strcmp(pnum,number)==0?putout(p)。none=0。p=pnext。NY None==0?printf(\ncan not find the data!) printf(\npress any key to return.)。getch()。void search2(struct student *)。int none=1。 char name[11]。struct student *p。p=head。clrscr()。printf(please in put a student39。s name:)。scanf(%s,name)。 直到確認(rèn)clrscr()。printf(Search results:\n)。formhead()。 while(p!=NULL)NY strcmp(pname,name)==0?putout(p)。none=0。p=pnext。YNnone==0?printf(\ncan not find the data!)。printf(\npress any key to return.)。 getch()。void search3(struct student *)。p1=head。m=menu3() 直到’0’=m=’6’clrscr()。printf(Please enter a highest score:\n)。scanf(%f,amp。high)。 直到確認(rèn)clrscr()。printf(Search results:\n)。formhead()。 switch(m)‘1’while(p1!=0)NYp1mathhigh?putout(p1)。 none=0。p1=p1next。YNNone==0?printf(\ncan not find the data!)printf(\npress any key to return.)。getch()。break?!?’與‘1’同理‘3’與‘1’同理‘4’與‘1’同理‘5’與‘1’同理‘6’與‘1’同理‘7’與‘1’同理struct student *sort(struct student *)。struct student *p1,*p2,*t,*temp。temp=headnext。 headnext=NULL。while(temp!=NULL)t=temp。 temp=tempnext。 p1=head。 p2=head。 while(taverp1averamp。amp。p1!=NULL)p2=p1。 p1=p1next。NYp1==p2?tnext=p1。tnext=p1。