C語言程序設(shè)計基于鏈表的學(xué)生成績管理系統(tǒng)_第1頁
C語言程序設(shè)計基于鏈表的學(xué)生成績管理系統(tǒng)_第2頁
C語言程序設(shè)計基于鏈表的學(xué)生成績管理系統(tǒng)_第3頁
C語言程序設(shè)計基于鏈表的學(xué)生成績管理系統(tǒng)_第4頁
C語言程序設(shè)計基于鏈表的學(xué)生成績管理系統(tǒng)_第5頁
已閱讀5頁,還剩15頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、華北科技學(xué)院計算機系綜合性實驗實驗報告課程名稱C語言程序設(shè)計實驗學(xué)期2011至2012學(xué)年第二學(xué)期學(xué)生所在系部計算機系年級2011專業(yè)班級計算機科學(xué)與技術(shù)B-111學(xué)生姓名學(xué)號任課教師實驗成績計算機系制精品實驗報告須知1 學(xué)生上交實驗報告時,必須為打印稿(A4紙)。頁面空間不夠,可以順延。2 學(xué)生應(yīng)該填寫的內(nèi)容包括:封面相關(guān)欄目實驗地點時間目的設(shè)備環(huán)境內(nèi)容結(jié)果及分析等。3 教師應(yīng)該填寫的內(nèi)容包括:實驗成績教師評價等。4 教師根據(jù)本課程的綜合性實驗指導(dǎo)單中實驗內(nèi)容的要求,評定學(xué)生的綜合性實驗成績;要求在該課程期末考試前將實驗報告交給任課教師。綜合性實驗中,所涉及的程序,文檔等在交實驗報告前,拷貝

2、給任課教師。任課教師統(tǒng)一刻錄成光盤,與該課程的期末考試成績一同上交到系里存檔。5 未盡事宜,請參考該課程的實驗大綱和教學(xué)大綱。C語言程序設(shè)計課程綜合性實驗報告開課實驗室:基礎(chǔ)五2012年7月6日實驗題目基于鏈表的學(xué)生成績管理系統(tǒng)-、實驗?zāi)康?、掌握鏈表的創(chuàng)建、遍歷顯示和消除;2、掌握鏈表數(shù)據(jù)的文件保存、讀取;二、設(shè)備與環(huán)境微型計算機、VC+6.0三、實驗內(nèi)容1、定義結(jié)構(gòu)體,創(chuàng)建鏈表structxsnodeintxh;charxm15;intgs;intyy;intwl;structxsnode*next;2、根據(jù)以上鏈表結(jié)點結(jié)構(gòu),實現(xiàn)以下功能a、學(xué)生學(xué)號、姓名、各門成績的錄入;b、鏈表數(shù)據(jù)顯示

3、及清除;c、鏈表數(shù)據(jù)的文件保存與讀取;四、實驗結(jié)果及分析1、運行結(jié)果主菜單蓑一 出 “鏈顯文備 一創(chuàng)數(shù)一 二 二 二 12 3 4-5數(shù)據(jù)顯示數(shù)據(jù)顯示KHRKXNKKXXKKJCKXHRH HXXJJIJJX M:甄 JCKXM;尊 MliKRNMJIXKMIJC學(xué)號 姓名 高數(shù)英語物理平均分潔或亶宋明江高紫-HJ IHJ 文 文909090799G699S979575857885638790.00 9.0095.00 ?8磔67.00鋅表顯示完畢,請按任意健繼續(xù)2、源程序主函數(shù)voidmain()intxz=0;structxs*head;head=init();while(xz!=5)me

4、nu();scanf(%d,&xz);switch(xz)case 1: create(head);break;case 2: print(head);break;case 3: save(head);break;case 4: read(head);break;精品printf(n系統(tǒng)退出,拜拜!n);break;default:printf(n選擇錯誤,請按任意鍵選擇!n);getch();break;fr(head);free(head);數(shù)據(jù)錄入源代碼voidcreate(structxs*hd)intxh,gs,yy,wl,i;charxm20;structxs*p;fr(hd);p

5、rintf(n請輸入學(xué)生個數(shù):);scanf(%d”,&num);for(i=0;ixh=xh;strcpy(p-xm,xm);p-gs=gs;p-yy=yy;p-wl=wl;p-next=hd-next;hd-next=p;printf(錄入數(shù)據(jù)完畢,請按任意鍵繼續(xù)!n);getch();添加記錄源代碼voidprint(structxs*hd)structxs*p;p=hd-next;if(p!=NULL)數(shù)據(jù)顯示n);printf(nprintf(*n);printf( 學(xué)號姓名英語物理平均分n);printf(*n); while(p!=NULL)printf(%4d ,p-xh);p

6、rintf(%10s,p-xm);printf(%8d,p-gs);printf(%7d,p-yy);printf(%6d,p-wl);printf(%8.2fn,(p-wl+p-wl+p-wl)/3.0); p=p-next;printf(*n);printf(getch(); else鏈表顯示完畢,請按任意鍵繼續(xù)!n);續(xù)!n printf(n);當(dāng)前鏈表為空,請先讀取文件或創(chuàng)建鏈表!n按任意鍵繼p rintf(*n);p rintf(*學(xué)生成績管理系統(tǒng)(1.0)*n);p rintf(*5);p rintf(*jb11-1 31 宋潔 2012-7-3*n);p rintf(*n);p

7、rintf(*1-創(chuàng)建餅表*n);查詢記錄源代碼void menu()system(cls);p rintf(*2-數(shù)據(jù)顯示p rintf(*3-保存文件p rintf(*4-讀取文件p rintf(*5-系統(tǒng)退出p rintf(*p rintf(請選擇操作(1-5:);*n)*n)*n)*n)源程序#includestdio.h#includestdlib.h#include#includeconio.hstructxsintxh;charxm20;intgs,yy,wl;structxs*next;;intnum=0;structxs*init()structxs*hd;hd=(struc

8、txs*)malloc(sizeof(structxs);hd-next=NULL;returnhd;voidfr(structxs*hd)structxs*p;p=hd-next;while(hd-next!=NULL)p=hd-next;hd-next=p-next;free(p);voidcreate(structxs*hd)intxh,gs,yy,wl,i;charxm20;structxs*p;感謝下載載fr(hd);printf(n請輸入學(xué)生個數(shù):);scanf(%d”,&num);for(i=0;ixh=xh;strcpy(p-xm,xm);p-gs=gs;p-yy=yy;p-w

9、l=wl;p-next=hd-next;hd-next=p;printf(錄入數(shù)據(jù)完畢,請按任意鍵繼續(xù)!n);getch();voidsave(structxs*hd)if(hd-next!=NULL)structxs*p=hd-next;inti;FILE*fp;fp=fopen(yh.txt,w);fprintf(fp,%3dn,num);for(i=0;ixh,p-xm,p-gs,p-yy,p-wl);p=p-next;fclose(fp);printf(n保存文件完畢,請按任意鍵繼續(xù)!n);getch();elseprintf(n當(dāng)前鏈表為空,不需要保存,請按任意鍵繼續(xù)!n);getc

10、h();voidread(structxs*hd)inti;structxs*p;FILE*fp;fr(hd);fp=fopen(yh.txt,r);fscanf(fp,%3dn,&num);for(i=0;ixh,p-xm,p-gs,p-yy,p-wl);p-next=hd-next;hd-next=p;fclose(fp);printf(n讀取文件完畢,t#按任意鍵繼續(xù)!n);getch();voidprint(structxs*hd)structxs*p;p=hd-next;if(p!=NULL)數(shù)據(jù)顯示n);printf(nprintf(I*n);printf( 學(xué)號 姓名高數(shù)英語物理

11、平均分n);printf(I*n);while(p!=NULL)printf(%4d,p-xh);printf(%10s,p-xm);printf(%8d,p-gs);printf(%7d,p-yy);printf(%6d,p-wl);printf(%8.2fn,(p-wl+p-wl+p-wl)/3.0);p=p-next;printf(*n);printf(鏈表顯示完畢,請按任意鍵繼續(xù)!n);getch();elseprintf(n當(dāng)前鏈表為空,請先讀取文件或創(chuàng)建鏈表!n按任意鍵繼續(xù)!n);voidmenu()system(cls);printf(*n);printf(*學(xué)生成績管理系統(tǒng)(1

12、.0)*n);printf(*n);printf(*jb11-131宋潔2012-7-3*n);printf(*5);printf(*1-創(chuàng)建鏈表*n);printf(*2-數(shù)據(jù)顯示*n);printf(*3-保存文件*n);printf(*4-讀取文件*n);printf(*5-系統(tǒng)退出*n);printf(*n);printf(請選擇操作(1-5:);voidmain()intxz=0;structxs*head;head=init();while(xz!=5)menu();scanf(%d,&xz);switch(xz)case 1:create(head);break;case 2:p

13、rint(head);break;case 3:save(head);break;case 4:read(head);break;case 5:printf(n系統(tǒng)退出,拜拜!n);break;default:printf(n選擇錯誤,請按任意鍵選擇!n);getch();break;fr(head);free(head);3、試驗收獲通過這次試驗,我掌握了鏈表的創(chuàng)建、遍歷顯示和清除功能,掌握了鏈表數(shù)據(jù)的文件保存、讀取,能夠熟練的使用VC+6.0,對C程序有了更深的了解。教師評價評定項目ABCD評定項目ABCD算法正確界囿美觀,布局合理程序結(jié)構(gòu)合理操作熟練語法、語義正確解析完整實驗結(jié)果正確義字

14、流暢報告規(guī)范題解正確其他:評價教師簽名:年月日代碼:#includestdio.h#includestdlib.h#include#includeconio.hstructxsintxh;charxm20;intgs,yy,wl;structxs*next;;intnum=0;structxs*init()structxs*hd;hd=(structxs*)malloc(sizeof(structxs);hd-next=NULL;returnhd;voidfr(structxs*hd)structxs*p;p=hd-next;while(hd-next!=NULL)p=hd-next;hd-n

15、ext=p-next;free(p);voidcreate(structxs*hd)intxh,gs,yy,wl,i;charxm20;structxs*p;fr(hd);printf(n請輸入學(xué)生個數(shù):);scanf(%d,&num);for(i=0;ixh=xh;strcpy(p-xm,xm);p-gs=gs;p-yy=yy;p-wl=wl;p-next=hd-next;hd-next=p;printf(錄入數(shù)據(jù)完畢,請按任意鍵繼續(xù)!n);getch();voidsave(structxs*hd)if(hd-next!=NULL)structxs*p=hd-next;inti;FILE*f

16、p;fp=fopen(yh.txt,w);fprintf(fp,%3dn,num);for(i=0;ixh,p-xm,p-gs,p-yy,p-wl);p=p-next;fclose(fp);精品printf(n!n);保存文件完畢,請按任意鍵繼續(xù)getch();elseprintf(n當(dāng)前鏈表為空,不需要保存,請按任意鍵繼續(xù)!n);getch();voidread(structxs*hd)inti;structxs*p;FILE*fp;fr(hd);fp=fopen(yh.txt,r);fscanf(fp,%3dn,&num);for(i=0;ixh,p-xm,p-gs,p-yy,p-wl);

17、p-next=hd-next;hd-next=p;fclose(fp);printf(n讀取文件完畢,請按任意鍵繼續(xù)!n);getch();structxs*p;p=hd-next;if(p!=NULL)數(shù)據(jù)顯示 n);printf(n感謝下載載printf(”*n);printf(學(xué)號姓名高數(shù)英語物理平均分n);printf(*n);while(p!=NULL)printf(%4d,p-xh);printf(%10s,p-xm);printf(%8d,p-gs);printf(%7d,p-yy);printf(%6d,p-wl);printf(%8.2fn,(p-wl+p-wl+p-wl)/

18、3.0);p=p-next;printf(*n);printf(鏈表顯示完畢,請按任意鍵繼續(xù)!n);getch();elseprintf(n當(dāng)前鏈表為空,請先讀取文件或創(chuàng)建鏈表!n按任意鍵繼續(xù)!n);voidmenu()system(cls);printf(*n);printf(*學(xué)生成績管理系統(tǒng)(1.0)*n);printf(*n);printf(*jb11-131宋潔2012-7-3*n)printf(*n);printf(*1-創(chuàng)建鏈表*n);printf(*2-數(shù)據(jù)顯示*n);printf(*3-保存文件*n);printf(*4-讀取文件*n);printf(*5-系統(tǒng)退出*n);printf(*n);printf(請選擇操作(1-5:);voidmain()intxz=0;struc

溫馨提示

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

評論

0/150

提交評論