綜合應(yīng)用實(shí)驗(yàn)_第1頁
綜合應(yīng)用實(shí)驗(yàn)_第2頁
綜合應(yīng)用實(shí)驗(yàn)_第3頁
綜合應(yīng)用實(shí)驗(yàn)_第4頁
綜合應(yīng)用實(shí)驗(yàn)_第5頁
已閱讀5頁,還剩8頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、一【實(shí)驗(yàn)?zāi)康摹恳?C語言程序設(shè)計(jì)語言為基礎(chǔ),完成具有一定難度的綜合程序設(shè)計(jì)。通過編寫、調(diào)試、運(yùn)行程序,進(jìn)一步掌握 C語言程序設(shè)計(jì)的基本方法和編程技巧,鞏固所學(xué)知識,提高分析問題和解決問題的能力。二【實(shí)驗(yàn)內(nèi)容】某班有最多不超過 30人 (具體人數(shù)由鍵盤輸入)參加期末考試,最多不超過6 門(具體門數(shù)由鍵盤輸入)定義結(jié)構(gòu)體類型描述學(xué)生信息,每個學(xué)生信息包括:學(xué)號、姓名、多門課的成績、總成績和平均成績。用結(jié) 構(gòu)體數(shù)組作為函數(shù)參數(shù),編程實(shí)現(xiàn)如下菜單驅(qū)動的學(xué)生成績管理系統(tǒng)。( 1) 錄入每個學(xué)生的學(xué)號、姓名和各科考試成績。( 2) 計(jì)算每門課程的總分和平均分。( 3) 計(jì)算每個學(xué)生的總分和平均分。( 4)

2、 按每個學(xué)生的總分由高到低排出名次表。( 5) 按學(xué)號由小到大排出成績表。( 6) 按姓名的字典順序排出成績表。( 7) 按學(xué)號查詢學(xué)生排名極其考試成績。( 8) 按姓名查詢學(xué)生排名極其考試成績。( 9) 按優(yōu)秀( 9010)0、良好( 809)0、中等( 708)0、及格( 607)0 、不及格( 05)9 5 個類別,對每 門課程分別統(tǒng)計(jì)每個類別的人數(shù)以及所占的百分比。( 10) 輸出每個學(xué)生的學(xué)號、姓名、各科考試成績以及每門課程的總分和平均分。要求程序運(yùn)行后先顯示如下菜單,并提示用戶輸入選項(xiàng):1. Input record2. Caculate total and average sco

3、re of every course3. Caculate total and average score of every student4. Sort in descending order by total score of every student5. Sort in ascending order by number6. Sort in dictionary order by name7. Search by number8. Search by name9. Statistic analysis for every course10. List record0. ExitPlea

4、se input your choice:三【題目分析】該題主要考查數(shù)組、指針、結(jié)構(gòu)體、函數(shù)調(diào)用相關(guān)操作,以及C 語言算法的掌握,所以完成該題要求具有較強(qiáng)的程序設(shè)計(jì)能力,如何調(diào)試程序也非常關(guān)鍵,通過這個程序可以學(xué)到以前調(diào)試短程序沒有的經(jīng)驗(yàn)。系統(tǒng)中 的每一功能幾乎都對應(yīng)一個子程序。四【實(shí)驗(yàn)結(jié)果】prlntf 廣n9ort in dictionary orer by nam*:a>l;Printscor* < stu n.a>;brea>case fe: tearchbyWum( tu;br*a>Jcoe : Searchby*a»e (siu# n.R ;

5、bed;a 10 SOtisticAMlyn s I stu. n);case:Printscore stu,n.a ;br«ak jcase :priatf (Knd of proqraa!0);exitl ):default prwtf Input error! el ;br*«>:C:UB#nAdminiftr«toAC><*ktop8.1main “xetuxn 0;/#Cr功護(hù)匕三心牟科仇工弔atfUWi入鬥龍 lnt »rnu vcidiIIlot ite*3elected;pzqrffox Stvscoxes ne ;pr

6、mtf Cl«2nput record n°);print! prxntftw2.CA£Qit« total <ndI*3>£££MxA1£ tot> andz押 >cox« of ev«xyaei;ey" score of every stMent ne);5 Sort in A«e«ndihby *co*B.Sort in asctndin order by nuaMrI. Sort in dictionary order byB. Se

7、arch by nuot>«r9 $»erch by w18.Statistic analysisII. List recordI.ExitPlwtt Input cMic«;3tuctont 1.val19S.«v«rs99tucMnt 2 tvanTl.avtrrstuctent 3Managewnt for Students* scoresI. 1nput record|.C*cul«t« total en *u«r9 cor* every coo«r« |4C»culat

8、» total and *u«r9 ocore of euer tud»rt .Sort in g.cend“9 ord«r tcoreB Sort in sctndin order by acore B.Sort in >«c«ndln9 order by nuatxr, Sort in dictionary ordr by B.Se«rcfi by nuae«rby ham10.Statistic nelywieII. Liet recordfttfl AAA4.print! (w4.3OIt print

9、! *S.lo»t printf l-e.Sorc prxntf (*?.Sortia descending ocdex by >cor< nw); ia ascndiag orer by core ne>la xwncHng ortr !>y n«kxr nw>: xn dictionary order by nane ne>printf iAl.S«Arcti by aiaMr nHprmtf ClO.mtlstic aruilyvis n*i: prmtf <*11 .Lift “crd r): prxntf eO.

10、Ciut ael;printf iPlease Inpat youx choice:*) leant&item3«Xectedl;ratumIst功亠 入止MteniMtvM KedScore IFFV stu w tint n»Xnt >3<mt i. j; prmtf 忙tlDrran« anl ieore!n* >fee (i.scan!mun八w【i】 MBe);fox (J二 J. j<w)<scant (wtfwt Cstu(a).score ! IjCAUs«rsVAdministrfttorD

11、1;sl(top8 TB. Search by ww lO.Statietic analytieList recordI.CxitPleeee Input yowr choice191A$D9S371S59S1G2ZXC8?X1737103QUETST91STT1port in descending order 沖 score功If j計(jì)且?工左各riQL前邕分fc千Nl" wi-i : 、 ", 一,KJ ttv,iat artat n>Maneaent for Stuoents scores1Input record2. C*culat< total and

12、 auerAt oeore ofcouorel<C*eul«t« total and rMf core of ev<nj tud«ntin descending ord«r by score5.Sort in ascending order bg score R.Sorl in eccendlng order by nuaber T.Sort in dictionary order by3. Search by ruiabr9.Search by 2”10 Statistic analyoie11.Liet recordsentPl»

13、;aee Input your choice;5i®t id;float SUff .COORSE KUM.gr.OOCR5E_KUM;for I j: ; jo; j*7SlOi(jB0jfoe (i= ;i<n;iZ(sxx. j) 、 score (;>averIJ a>c?sub:prxntf (wcoursetd:sun=t.Of9 aver=%.Ofn°# J 】a is J .over *j);Search by nuakwr ”6 by om«10 Statistic anZyis11 Ll»t recordBoExit

14、»】 Input your choice 5 .mwMflUBgn 元9U&*1序/void SortDyScort (STU stu( 4 lot nflat (ecanpar«) float a< float b) 31xatfor ll»0;i<n9(k-i;tor (j-i* ; jo.3(ii( leccffTrrel Otv l: >3um> stu(k) .sub) I In);>if k!=ii3(fox 1 h二: A ji h")3<3wapFloet<C8Uik)score(hv&#

15、187;C3tu(x)»score'h)>)Jvaprioat 4 9tu;k. rjnit 4Stu,lj ,uhu :_Svaprioat 4>tu kl.av«xf tun .avex) _- Sort in g“ndin9 order by ocor101 dSDMST195102 ZXCT61?31B3QME71"157for Student* «cor»«1.Input recordI.C«ulet« total end vere cart ofI Ciculate total &#

16、171;nd uerege score of » Sort 5 Sort B.Sort ?. Sortin d«oe«ndir>9 ord»r core in ascending order by score in atcending order oy nuetxr inord«r bg hmml<Seerch by nuabr 9 Search by naao 19 Statifttle analaioII Li»t recordB Exit98oo>r«ueq studentiat Ascending

17、<float a > float b) B(<«tusa a<b;;呼 YlI : 八QKK扶降序捋烈"mt Descending ifloat a« float bB(return a>D; 一 一 一L>/ 二碎阿1 單iiJLi歳辛數(shù)理/void Swap Float If lost wx float ey3(float tMp;tCOp eM;,二羅:ytwnp:L>"2卩如 + ¥ =/eld Swap Lor g (long Ax« long 4y)(C U>ersAdmin

18、i5tratorDe$ktop8Sortin »«c»nc$59 orderby fxitxr s101989713538102zxc ?Mm7103QK77S157P1»m* Input your ehoieerCS: y-tenF;Han»9«Mnt for Student*'scores1. Irtput record2 Caculat* total andscore of every cousre3 Caculete total and»cor» of every etudet*» Sor

19、t in dMCoding order by xo.5 Sort in acerxiing order by sccre( Sort in amending ordr by rxebtrr Sort in dictionary or (tor 時 na”B.$»«rch nuabtr3 Swrch bv nao«lO.Statietie aAalyeieH 丄"t recordInut your choiG»:7. . . .void SvapChar <ehar x 4 char y:)char tesp MAX JZN : atxcp

20、y ItearX?;101asoSt9T19SU1032 A QK7S15779ff 6 H人攏» tifi dictionary order natw;char “叩 MMC Xnri; itrcpy(t«p. x7; strcpy* x y ,iCAU«eriAdmini$tr«torD<sktop8.1trcpy(y, tonp);遜殽於紇二Jfili拓王杵徽迫門”第元M恰從任和立埒呼/ void AsSortbyNum (3TV stu(j#xnt n, mt a>lnt Efox (1- > i<n- iforiif (

21、stuJj nu»<stu.r; noi)4: IIf (!(!>for 心丨:Swaprloat (43tv(k .scoTe t <43tu(i scored I;SwapFlot asu .k. 9h,= j .sub: _SwApFloat (&atu k. .avex. tttu i #”);_人9w*pLonq <«stuk .bub> &atu:i:l naai二 三SwapChar (itutk .ruxi色n 1 n«nei;_二_102 ZXC t7 ts in S7Kano9e«i

22、87;nt for Students scores11 Input record2 C*cul»t« total and aver*9* c«r» of zery eou«r»3 C»culat» total and average score of every ttudent » Sort in detcending order 沖 xoreB Sort in ascending ord” by 9cor»B. Srt inord" by nueber? Wrt in diction

23、aryby m> Search by numberS Search bg10.Statistic ar>ely«i«11 Li»t record k ExitInput your choice :SInput tM nubr you want to arehi 101101 ASO 93?1»5 Mfor Studentsa ceoroc1 Input recordI Caculat total and avtrag* ec«r» of every coutre 3 Caculote total and overoge x

24、or of every atuctent "Sort in descending order b| score< Sort in 28,09 ordtr by score Sort in “rxhng or“by nusber 岡尙倂咅諭入注全voxa »OTU)yaae (Vru itu J. mt a. rat >3(int ij.t;for <i< );i<n L;i)<er <3-x< :,5;j丨<Xf (stxGnpiatu j:»ta.x) .oam <<foe <! <S

25、wAprioat Uituflscore:tItitulj1.*cor«It);19wapFlo«t Ustul&l. sua> '二嚴(yán) SvapFloet ICstuokm. "tu : j «ver> ;二!干 H SwapLong.nun, 4stuj .nuni:二,二® *SiChai (stu(l, name.at.ulj <no*eH _ 一I.SmccD by na»e10 Statiotie11 Lxet record Exit_ _ _ _ _v«Ld SeaxchbyV

26、iR (9T7 >tu( *lal Dr lAt &>long mUxr.lnt 1>):prlntf i11 Inpat the rtuntxr you want to March:e) r scanX (w%Ue, ninber);for i ;x<n x*>“ I9tuai.nuBB nunber)if fstufi" numrurber(print! <stvnum,9tv 丄 na»«);foe<prxntr CW.orxt11,»xu: 1 .score j);Iprlntfsum>3t

27、afi).over>retum ;ptlntrfound! dw| ;>/回致巧就法尊W芝找壬成噢三=乞直心MT void SearchbyNoe I STU stu f lat n,lat m(ci)ar ilMAX LEM);int itj? printf (°Tnput the naae you want to search:e);scanf (%«.>>for (Xf stroiF I 3u _ i' nnne. ?o I(prlntf (UuyTWBLn)d naiM):<prlatr«tu:1.core J:):&

28、gt;printf.0fn*f 3ta*iw.sum,3tu*i* .avrr>return.C :U sersAdmin istratorDe$ktop8 1Fleate Input your choice:10<600e eex6“0 eexre-rsi33.311S«-8Si33.33Zi33.33%ieo0 eoxror course 2:SO0 eez669ee eez76-73i33.331S(B 89iW.331M 99in.inieo0e eezFor course 1 :ManageBent for Student»ascoreG1 .Inpu

29、t recordl.Caculate total andocort of etry couorel.Caeulate total andocore of «u«ry etudent*.$ort in descending ordr score41 m W入憶辛tCAUs<r«Adminiftr«torDe$ktop8.1'B Search by nu.b.r3 Search Dy na lO.Statiatie analaie丄“t recordrciitPlease Input your cholcH101ASD9S9T19591103QUEreTSisr7$102zxc?tsinrH 3 P cQ»a*nt forStudent© coreo1.Input recordB Ceculote total and au«r«9» score of /ry cousre v CACulete total end auerae 6cort of very ttudent m $«rt inorder »cor»5$«rt in ascending ord<r bg ocwG Scrt in aecndin

溫馨提示

  • 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

提交評論