【正文】
ext。 while(p!=NULL) { i++。 printf(|rec|nO | name | sc1| sc2| sc3| sum | ave |order|\n)。 p=h。 STUDENT *p。 strcpy(s,p)。 if(strlen(p)count)printf(\n too long! \n)。 do{ printf(prompt)。 } return(h)。 infonext=h。 infoaverage=(float)s/N。 s+=infoscore[i]。 if(infoscore[i]100||infoscore[i]0) printf(ERROEEnter score in the range of(0100)!\n)。 scanf(%d,amp。iN。 s=0。 inputs(enter name:,infoname,15)。39。 } inputs(enter no:,infono,11)。 if(!info) { printf(\nFailed to apply for memory)。 STUDENT *h=NULL,*info。 } /*creat a new list*/ STUDENT *create() { int i。 return c。 fflush(stdin)。 scanf(%d,amp。 gotoxy(10,21)。 } textbackground(BLACK)。i++) { gotoxy(10,i+1)。 for(i=0。 window(11,3,53,19)。i++) putch(0xcd)。 for(i=1。 } gotoxy(10,20)。 gotoxy(54,i)。i++) { gotoxy(10,i)。 for(i=3。i++) putch(0xcd)。 for(i=1。 gotoxy(10,2)。 /*setting the textmode*/ textcolor(YELLOW)。 clrscr()。 } menu_choice() { char *menu[]={***************MENU***************, 0. init list, 1. Enter list, 2. Delete a record from list, 3. print list , 4. Search record on name, 5. Save the file, 6. Load the file, 7. pute the score, 8. insert record to list , 9. copy the file to new file, 10. sort to make new file, 11. append record to file, 12. Quit}。 getch()。 gotoxy(1,25)。 printf(5. Please enter according to the relevant tips.\n)。t fet to save information after changing。\n)。\n)。\n)。 printf( ANSWERS TO FREQUENTLY ASKED QUESTIONS \n)。 } void help() { clrscr()。 getch()。 gotoxy(1,25)。 printf( feel free to contact me!\n)。 printf(\n\n)。 printf(\n Telephone Number: 15998582984)。 printf(\n School: Dalian University of Technology)。 printf(\n Student Number: 202112043)。 printf(\n\n)。 } return result。clrscr()。 default : cprintf(ERRORIllegal Input! Please try again!\n)。clrscr()。439。break。: help()。 case 39。fflush(stdin)。239。break。: result=1。 switch(c) { case 39。 input: cprintf(Please enter your choice:)。 cprintf(%s,home[i])。i5。 cprintf(|||***********************WELCOME YOU********************|||)。s Score Management System)。 gotoxy(20,4)。 while(1) { gotoxy(10,2)。 textbackground(GREEN)。 char *home[]={****************Home Choose**************, 1. Enter Main Menu, 2. Contact Me, 3. Help, 4. Exit}。 int i,result=2。 } } } } int homepage() { void contact()。break。break。break。 break。break。 break。break。break。break。break。break。break。 if(homepage()==1) 學(xué)生成績(jī)管理系統(tǒng)設(shè)計(jì) 11 { while(1) { clrscr()。 int menu_choice()。 STUDENT *head。 /* copy the file*/ STUDENT *sort(STUDENT *h)。 /*insert a new record*/ void append()。 /*load information from a file*/ void puter(STUDENT *h)。 /* search student by name*/ void save(STUDENT *h)。 /*display the students39。 /* creat a new list*/ STUDENT *delete(STUDENT *h)。 STUDENT *init()。 /*the rank*/ struct xs *next。/* the sum of the courses*/ float average。s name as a string*/ int score[N]。s number as a string*/ char name[15]。 感謝使用本程序,歡迎提出意見(jiàn)和建議! ?。? C/C++語(yǔ)言程序設(shè)計(jì)報(bào)告 10 C 語(yǔ)言源程序: /* Source File*/ /**********************/ include include include include include include include define N 3 typedef struct xs /*define the data struct*/ { char no[11]。 友好提示:請(qǐng)?jiān)谶\(yùn)行程序前先閱讀程序幫助。衷心祝愿老師工作順利,天天快樂(lè)! 附錄:程序使用說(shuō)明 程序 運(yùn)行環(huán)境: TURBO C ; 輸入說(shuō)明:本程序雖然能夠屏蔽非法輸入,但最好按提示輸入,以免造成難以預(yù)料的后果。 4. 最后感謝老師一學(xué)期來(lái)的辛勤講授,讓我對(duì) C 語(yǔ)言從陌生到熟悉,并成為自 己的一個(gè)幫手。我認(rèn)為沒(méi)有必要在上課時(shí)間講授課本上的基礎(chǔ)知識(shí),而重點(diǎn)應(yīng)該是講一下編程的技巧 和方法。我在數(shù)學(xué)建模實(shí)踐班上課,經(jīng)常需要編程來(lái)檢驗(yàn)自己的推測(cè),如果沒(méi)有學(xué)習(xí) C 語(yǔ)言,真的不敢想象結(jié)果會(huì)如何。現(xiàn)在想想,確實(shí)這樣,連這樣的小程序編起來(lái)都這么費(fèi)勁,更別提大一點(diǎn)的了。學(xué)會(huì)課本上知識(shí)并不代表你會(huì)運(yùn)用它。 圖 4( a) .程序首頁(yè)示意圖 (電子版為彩色) 圖 4( b) .程序 主 頁(yè)示意圖 (電子版為彩色) C/C++語(yǔ)言程序設(shè)計(jì)報(bào)告 8 圖 4( c) .程序 輸入 示意圖 (電子版為彩色) 圖 4( d) .程序 輸出 示意圖 (電子版為彩色)