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

下載本文檔

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

文檔簡介

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

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

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

4、入排序 顯示學(xué)生信息【2】系統(tǒng)模塊調(diào)用層次圖3.2核心算法描述1. 總體模塊流程圖:開始學(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é)生信息無找到有關(guān)信息4.插入模塊:for(i=0;ii nput;i+)stui. nu m=idF(flag!=0)學(xué)號信息已經(jīng)存在輸入要插入學(xué)生信息5刪除模塊:ask != nTstui. num = delnumT (flag=0)F(flag!=0)刪除指定學(xué)生的信息沒有要刪除的學(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)特點【1】特點:這個學(xué)生信息管理系統(tǒng)建立了學(xué)生信息的結(jié)構(gòu)體,實現(xiàn)了學(xué)生信息的錄入、添加、修改、刪除、查找等功能,并能計算學(xué)生的平均分和總分,對學(xué) 生進行排序。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?找不到要刪除的學(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é)號為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. 本站所有資源如無特殊說明,都需要本地電腦安裝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)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論