软件工程师开发综合程序案例

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

1........................................................................................................................11.1....................................................................................................................11.2........................................................................................................12...................................................................................................................22.1................................................................................................................................32.2................................................................................................................................32.3................................................................................................................................42.3.1.....................................................................................................42.3.2.........................................................................................................................62.2.3.............................................................................................................82.4......................................................................................................................................162.4.1........................................................................................................................172.4.2...............................................................................................................................172.4.3...............................................................................................................................172.4.4.......................................................................................................212.5..........................................................................................................................292.5.1...............................................................................................................................292.5.2...............................................................................................................................302.6..........................................................................................................................342.7..............................................................................................................................34................................................................................................................................................35160CPU6070196870FritzBauer1968IEEE(1)(2)(1)2CC3WindowsWindows2-1(a)2-1(a)2-1(b)2-1(c)1)2-1(a)12)Å3)14)(?)5)4WindowsWindows12345WindowsWindowsNikiklausWirth=+C2.3.1E.W.DijkstraGOTOGOYOGOTObowlofspaghettiBS1965DijkstraGOTOGOTO1966BöhmJacopini2-1Windows(a)(b)(c)51968DijkstraGOTOGOTOGOTO1972IBMMills2)3)4)8AnalyzeexamresultanddecideiftutionshouldberaisedInitializevariablesInputthetenquizgradesandcountpassesandfailuresPrintasummaryoftheexamresultsanddecideiftuitionshouldberaisedfailuresstudentInitializevariablesInitializepassestozeroInitializefailurestozeroInitializestudenttoonefailuresstudentInputthetenquizgradesandcountpassesandfailuresWhilestudentcounterislessthanorequalto10InputthenextexamresultIfthestudentpassedAdd1topasseselseAdd1tofailures6AddonetostudentcounterPrintasummaryoftheexamresultsanddecideiftuitionshouldberaisedPrintthenumberofpassesPrintthenumberoffailuresIfmorethan8studentspassedPrint“Raisetuition”2-2C2-32.3.2InitializepassestozeroInitializefailurestozeroInitializestudenttooneWhilestudentcounterislessthanorequalto10InputthenextexamresultIfthestudentpassedAdd1topasseselseAdd1tofailuresAddonetostudentcounterPrintthenumberofpassesPrintthenumberoffailuresIfmorethan8studentspassedPrint“Raisetuition”2-2#includestdio.hmain(){intpasses=0;intfailures=0;intstudent=1;intresult;while(student=10){printf(“Enterresult(1=pass,2=fail):”);scanf(“%d”,&result);if(result==1)++passes;else++failures;student+=1;}printf(“Passeds%d\n”,passes);printf(“Failed%d\n”,failures);if(passes8)printf(“Raisetuition\n”);return0;}2-372-42-52-6N-S2-42-582-22.2.3,,2.2.22-7♦♦2-6(b)2-6(a)2-79♦♦♦1)WindowsF?*2-82)Windows,,,F,fQ,qA,aESC3)♦∈∈2-810♦♦♦/*di[8]dj[8]-1+pi0+pj*/♦intgameRes;/*0esc-1gameRes=1*/♦/*,,,*/#defineUP0x4800#defineDOWN0x5000#defineLEFT0x4b00#defineRIGHT0x4d00/**/#defineENTER0x1c0d#defineSPACE0x3920/*F,f*/#defineUPPERF0x2146#defineLOWERF0x216611/*Q,q*/#defineUPPERQ0x1051#defineLOWERQ0x1071/*A,a*/#defineUPPERA0x1e41#defineLOWERA0x1e61/*ESC*/#defineESC0x011b/**/4)2-7C2-9intmain(){initGraph();/**/do{newGame();/**/intgameRes=0;do{intkey=getKey();/**/if(key==ESC){gameRes=0break;}switch(key){key}if(checkWin())/**/gameRes=1;}while(!gameRes);}while(!confirm(gameRes));return0;}12gameResgameRes01-1gameRes0ESCbreakGOTOvoidinitGraph()voidnewGame()intgetKey()intcheckWin()10intconfirm(int)gameResgameRes=0escgameRes=-1gameRes=1Confi

1 / 37
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功