學(xué)生信息管理系統(tǒng)C語(yǔ)言編寫-編輯學(xué)生信息如何寫_第1頁(yè)
學(xué)生信息管理系統(tǒng)C語(yǔ)言編寫-編輯學(xué)生信息如何寫_第2頁(yè)
學(xué)生信息管理系統(tǒng)C語(yǔ)言編寫-編輯學(xué)生信息如何寫_第3頁(yè)
學(xué)生信息管理系統(tǒng)C語(yǔ)言編寫-編輯學(xué)生信息如何寫_第4頁(yè)
學(xué)生信息管理系統(tǒng)C語(yǔ)言編寫-編輯學(xué)生信息如何寫_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、1設(shè)計(jì)目的32設(shè)計(jì)題目及要求33設(shè)計(jì)算法分析33.1模塊調(diào)用層次圖33.2核心算法描述43.3系統(tǒng)特點(diǎn)64程序代碼65調(diào)試情況86結(jié)論 11學(xué)生信息管理1. 設(shè)計(jì)目的本課程設(shè)計(jì)的目的就是要通過(guò)一次集中的強(qiáng)化訓(xùn)練,使學(xué)生能及時(shí)鞏固已學(xué)的知識(shí),補(bǔ)充未學(xué)的但又必要的內(nèi)容。 進(jìn)行課程設(shè)計(jì)目的在于加深對(duì)程序設(shè)計(jì)基礎(chǔ)中基礎(chǔ)理論和基本知 識(shí)的理解,促進(jìn)理論與實(shí)踐的結(jié)合,進(jìn)一步提高程序設(shè)計(jì)的能力。具體目的如下:1 使學(xué)生更深入地理解和掌握該課程中的有關(guān)基本概念,程序設(shè)計(jì)思想和方法。2 培養(yǎng)學(xué)生綜合運(yùn)用所學(xué)知識(shí)獨(dú)立完成課題的能力。3培養(yǎng)學(xué)生勇于探索、嚴(yán)謹(jǐn)推理、實(shí)事求是、有錯(cuò)必改,用實(shí)踐來(lái)檢驗(yàn)理論,全方位 考慮問(wèn)

2、題等科學(xué)技術(shù)人員應(yīng)具有的素質(zhì)。4提高學(xué)生對(duì)工作認(rèn)真負(fù)責(zé)、一絲不茍,對(duì)同學(xué)團(tuán)結(jié)友愛(ài),協(xié)作攻關(guān)的基本素質(zhì)。5培養(yǎng)學(xué)生從資料文獻(xiàn)、科學(xué)實(shí)驗(yàn)中獲得知識(shí)的能力,提高學(xué)生從別人經(jīng)驗(yàn)中找到解決問(wèn)題的新途徑的悟性,初步培養(yǎng)工程意識(shí)和創(chuàng)新能力。6對(duì)學(xué)生掌握知識(shí)的深度、運(yùn)用理論去處理問(wèn)題的能力、實(shí)驗(yàn)?zāi)芰Α⒄n程設(shè)計(jì)能力、 書面及口頭表達(dá)能力進(jìn)行考核。2. 設(shè)計(jì)題目及要求【1】設(shè)計(jì)題目【2】要求實(shí)現(xiàn)如下功能:(1) 建立學(xué)生信息的結(jié)構(gòu)體(2) 學(xué)生信息的初始化(可以從文件獲取)(3) 學(xué)生信息的添加、修改、刪除、查找(4) 學(xué)生信息的輸出(5) 對(duì)學(xué)生信息按學(xué)號(hào)、成績(jī)排序(6) 計(jì)算一門課的平均分和總分(7) 將學(xué)生

3、信息保存為文件綜合應(yīng)用數(shù)組、指針、結(jié)構(gòu)體、文件等,對(duì)該設(shè)計(jì)題目進(jìn)行設(shè)計(jì)和實(shí)現(xiàn)。課 程設(shè)計(jì)完成后,提交課程設(shè)計(jì)報(bào)告。3. 設(shè)計(jì)算法分析3.1 模塊調(diào)用層次圖【1】變量描述定義形式/名稱含義/作用數(shù)組char n ame20定義姓名數(shù)組結(jié)構(gòu)體struct stude nt stu50聲明一個(gè)結(jié)構(gòu)數(shù)組全局變量int in put=0;float ave,sum;FILE *fp;全局變量標(biāo)記當(dāng)前錄入學(xué)生個(gè)數(shù)文件stuist2.doc保存學(xué)生信息函數(shù)Save InputStu DelStu ModifyStuFin dStu In sertStu SortStu ListStu保存錄入刪除修 改查找插

4、入排序 顯示學(xué)生信息【2】系統(tǒng)模塊調(diào)用層次圖3.2核心算法描述1. 總體模塊流程圖:開(kāi)始學(xué)生信息修改查詢插入刪除排序保存結(jié)束2. 修改模塊:for(i=0;i=15;i+)for(i=0;ii nput;i+)stui. num=idT(flag!=O)F (flag!=0)輸出修改后學(xué)生信息prin tf(nn nu II)3. 查詢模塊:for(i=0;i=15;i+)for(i=0;ii nput;i+)(stui. num=id)輸出查詢后學(xué)生信息prin tf(nn null)(stui.classid=id)T (flag=0)F( flag!=0)輸出查詢后學(xué)生信息prin tf

5、(nnn ull)J!strcmp(stui.niame,name)_輸出查詢后學(xué)生信息無(wú)找到有關(guān)信息4.插入模塊:for(i=0;ii nput;i+)stui. nu m=idF(flag!=0)學(xué)號(hào)信息已經(jīng)存在輸入要插入學(xué)生信息5刪除模塊:ask != nTstui. num = delnumT (flag=0)F(flag!=0)刪除指定學(xué)生的信息沒(méi)有要?jiǎng)h除的學(xué)生i=O;ii nput;i+for(j=i;ji nput;j+)刪除成功且 顯示刪除后數(shù)據(jù)6.排序模塊:chose=1Tfor(i=0;istuj. numT J-Ftemp=stuistui=stujstuj=tempfo

6、r(j=i+1;ji nput;j+)for(j=i+1;ji nput;j+)stui.avestuTtemp=stuistui=stujstuj=tempfor(i=0;ii nput 1;i+)3.3系統(tǒng)特點(diǎn)【1】特點(diǎn):這個(gè)學(xué)生信息管理系統(tǒng)建立了學(xué)生信息的結(jié)構(gòu)體,實(shí)現(xiàn)了學(xué)生信息的錄入、添加、修改、刪除、查找等功能,并能計(jì)算學(xué)生的平均分和總分,對(duì)學(xué) 生進(jìn)行排序。4. 程序代碼11程序代碼void Help();void Save(struct stude nt stu);void In putStu(struct stude nt stu);void DelStu(struct stude

7、 nt stu);void ModifyStu(struct stude nt stu);void Fi ndStu(struct stude nt stu);void In sertStu(struct stude nt stu);void SortStu(struct stude nt stu);void ListStu(struct stude nt stu);void mai n()struct stude nt stu50;struct stude nt *p;int in;int in1;char ch;void In putStu(struct stude nt stu) pp=

8、stu;system(cls);int i;prin tf(Number of stude nts you want to en ter in formati on:);sea nf(%d,&in put);if(fp=fope n(i nputdata.sys,wb+)=NULL)prin tf(Ca nnot ope n file strike any key exit!);geteh();exit(1); void ModifyStu(struet stude nt stu) system(els);pp=stu;int id,i,flag=1;if(fp=fope n( modifyd

9、ata.sys,wb+)=NULL)prin tf(Ca nnot ope n file strike any key exit!);geteh();exit(1); void Fin dStu(struet stude nt stu) system(els); int i=0,id,flag=1,ehose;prin tf(nPlease seleet query: 1.N o. inq uiries by sehool;2.Query by elass;3.Query by n amen); sea nf(%d,&ehose);switch(chose)ease 1:prin tf(Ple

10、ase en ter your query No. stude nts:);sea nf(%d,&id);for(i=0;ii nput;i+)if (stui. num=id) flag=0;stui.sum=stui.score1+stui.score2+stui.score3;stui.ave=stui.sum/3;printf(nNo. Studies Name No. elasses The first subjee The seeond subjeet The third subjeetAverage Totaln);void In sertStu(struet stude nt

11、stu) system(els);int flag=1;pp=stu;int i,id;if(fp=fope n(i nsertdata.sys,wb+)=NULL)prin tf(Ca nnot ope n file strike any key exit!);geteh();exit(1); void ListStu(struet stude nt stu) int i=0;for(i=0;ii nput;i+) stui.sum=stui.score1+stui.score2+stui.score3;stui.ave=stui.sum/3;printf(nNo. Studies Name

12、 No. elasses The first subjee The seeond subjeet The third subjeetAverage Totaln);for(i=0;ii nput;i+)pri ntf(n%d%s%dt%dt%dt%dt%d %d,stui. nu m,stui. name,stui.classid,stui.score1,stui.score2,stui.score3,stui.ave, stui.sum);geteh();void DelStu(struct stude nt stu) system(cls);pp=stu; int delnu m,flag

13、=1; char ask;int i,j;if(fp=fope n(Deldata.sys,wb+)=NULL) prin tf(Ca nnot ope n file strike any key exit!);getch(); exit(1); void SortStu(struct stude nt stu) system(cls);int i,j,chose;struct stude nt temp;prin tf(To sort the data before:n);printf(nNo. Studies Name No. classes The first subjecThe sec

14、ond subject The thirdsubjectAverage Totaln);for(i=0;ii nput;i+)printf(n%d %s %d %dt %dt %dt %dt %dn,stui.num,,stui.classid,stui.score1,stui.score2,stui.score3,stui.ave,stui.sum);printf(n1.Sort by Student IDt2.By the average score (highlow) Sortn);void Save(struct stude nt stu) int i,j; pp=s

15、tu;system(cls);prin tf(nnnn tttSavi ng);if(fp=fope n(stu_list2.doc,wb+)=NULL) prin tf(Ca nnot ope n file strike any key exit!);getch();exit(1);【2】程序執(zhí)行結(jié)果S&v ing*Studcnt nf ornat ion Manasienent Systen* MMmmkkmmmwmI* Infomation maintenance*_ Inf O PdAt itJfl R& 1)0( XXM XX XhhhhkkkxkM.Stat ist icskhxx

16、hhhxhhhhhhhhhkxkk且貝且貝xx At買jdid|yNot the students you want to dele11?找不到要?jiǎng)h除的學(xué)生信息KWKMwj irst - Int ormat ion maintenance*-*-*kmkmxkmkkI.create student recore file* k* 2, A ild Student Reco rds mkmmwmmmmmmm wmju-)d|yDelete successfDeleted dataiNo. Studies Nae Nd. clA&se$ The first subjec The second su

17、bject The thipd subj ectAuerage Totalarid 1 7BH777 交刪除了學(xué)號(hào)為12的學(xué)生信息aue found the inFornaition vou wantstudentso. of new students enter schoo1:12 tudents enter a new name:o of new students enter school:lew stu.den七占 enter 3 resultshe first subjec: 87he second subject = 89he third subject: 7?ew information After tlie students reuiseu|修改學(xué)生信息No. Studies Name No. ectAverage Totalclasses Tlie first subjec The second suibject The third subjiz夕抑187B977842533 hmm 1789689B5257_新學(xué)生信息記錄Sav iny *:*Student nfornation Managenent Systen*MMmxxx.

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論