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

下載本文檔

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

文檔簡介

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ì)的目的就是要通過一次集中的強(qiáng)化訓(xùn)練,使學(xué)生能及時(shí)鞏固已學(xué)的知識,補(bǔ)充未學(xué)的但又必要的內(nèi)容。 進(jìn)行課程設(shè)計(jì)目的在于加深對程序設(shè)計(jì)基礎(chǔ)中基礎(chǔ)理論和基本知 識的理解,促進(jìn)理論與實(shí)踐的結(jié)合,進(jìn)一步提高程序設(shè)計(jì)的能力。具體目的如下:1 使學(xué)生更深入地理解和掌握該課程中的有關(guān)基本概念,程序設(shè)計(jì)思想和方法。2 培養(yǎng)學(xué)生綜合運(yùn)用所學(xué)知識獨(dú)立完成課題的能力。3培養(yǎng)學(xué)生勇于探索、嚴(yán)謹(jǐn)推理、實(shí)事求是、有錯(cuò)必改,用實(shí)踐來檢驗(yàn)理論,全

2、方位 考慮問題等科學(xué)技術(shù)人員應(yīng)具有的素質(zhì)。4提高學(xué)生對工作認(rèn)真負(fù)責(zé)、一絲不茍,對同學(xué)團(tuán)結(jié)友愛,協(xié)作攻關(guān)的基本素質(zhì)。5培養(yǎng)學(xué)生從資料文獻(xiàn)、科學(xué)實(shí)驗(yàn)中獲得知識的能力,提高學(xué)生從別人經(jīng)驗(yàn)中找到解決問題的新途徑的悟性,初步培養(yǎng)工程意識和創(chuàng)新能力。6對學(xué)生掌握知識的深度、運(yùn)用理論去處理問題的能力、實(shí)驗(yàn)?zāi)芰?、課程設(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) 對學(xué)生信息按學(xué)號、成績排序(6) 計(jì)算一門課的平均分和總分(

3、7) 將學(xué)生信息保存為文件綜合應(yīng)用數(shù)組、指針、結(jié)構(gòu)體、文件等,對該設(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 In putStu DelStu ModifyStuFin dStu In sertStu SortStu ListStu保存錄入刪

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

5、 tf(nn null).(!strcmp(,name輸出查詢后學(xué)生信息無找到有關(guān)信息4.插入模塊:for(i=0;ii nput;i+)stui. nu m=idF(flag!=0)學(xué)號信息已經(jīng)存在輸入要插入學(xué)生信息5刪除模塊:ask != ni=0;ii nput;i+stui. num=delnumT (flag=0)F(flag!=0)for(j=i;ji nput;j+)刪除指定學(xué)生的信息沒有要?jiǎng)h除的學(xué)生刪除成功且 顯示刪除后數(shù)據(jù)6.排序模塊:一一chose=1chose=2)for(i=0;ii nput-1;i+)for(i=0;ii nput-1;i+)for

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

7、stude 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

8、) pp=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 nany key exit!);geteh();exit(1); void ModifyStu(struet stude nt stu) system(els);pp=stu;int id,i,flag=1;if(fp=fope n( modifydata.sys,

9、wb+)=NULL)prin tf(Ca nnot ope nany 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(Please en ter your query

10、 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 stu) system(els);int

11、flag=1;pp=stu;int i,id;if(fp=fope n(i nsertdata.sys,wb+)=NULL)prin tf(Ca nnot ope nany 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 No. elasses The first subjee The

12、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=1;char ask; int i,j;if(fp=fope n(De

13、ldata.sys,wb+)=NULL)prin tf(Ca nnot ope nany 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 subjec The second subject The third subjectAverage Totaln);for(

14、i=0;iC JC? B 8 t at is: t ic S HXXXXHXXXXKKXKKiMKJgZMaOf* M 員萱 X 良虹)C 比 4 e X is: t JHXHXKXMLKfOCKXKXMLKKXKKXKJtKJOt *Please car-f&ct choice- 1* * * K f i.rst InfoTrt盤匸 ion maint乜nein匚巳士* M-_*1create student recore file* *2.Add Student Recordswmwmmmmmmmmm *3.Student record to delete* *4. An&nd the s

15、tudent records* mxmc5 . Retutn to preuious menu* ?t*Pleage cor-iec:t cho ic? =1Nunhe v of students you uant to enter inf orvirtt ion : 1Please enter- chu t&rrectEnter the f irst 1 ninber of school students ;12 No 1 entep 七lie nanes oF students =lijjFlense enter the nunber of classes studentsThe f ir

16、st sLibjeC -78The second subject: 89The third subject: ?6這是建立學(xué)生信息文件kmkmmmmm4. Anend the student pecords*5. fleturn to preu io us menu*Please covrect choice:2ohuj*u.n ic lia.i*ud6 xug: hato =15(lake sure that you uant to insert No. students:pname of student input:gjjflease enter the nunber of clase?

17、students:1Name of student input1_1 j_r n i_f ini It n n 1-1 n miT m-i n n n n n naL-i n n mn m n n n n dil kmn- 7AdiSkenu: E7il丄3keiiiu 66* w *#* x J .x * jr jF jT * f dr w #*n n n n n n n x n 1=11=1 n it n n 丄r 1=1 n nn n n m=i n i- in 1-1 Successful insertion of dataInserted after the data-No Stud

18、iesNane Mo.classcEThe f irstsubjec Tlie second subject I he third subjeg t: Avcr-aeTotal12 hjj 176S9968726327?36 gjj17887667?231_添加學(xué)生信息并計(jì)算平均分和總分 賈図買 F ii*st. InFornat ion esl in I: enaLrmie *mmmmmwmwmi.create student recode File*ww 卜xjcxxxjchjQ -冃an Student EeCOP4s xmmmmmkxkkxk MKMXKMMMK3.Student re

19、cord to delete* brf* f k*Plcase cotrect choice:3Please enter pou UAnt to delete Nd. students:1Uhethei* or not to CDnFii*ni 1tlie de Let7 3.n numlbei is 1 cHqo 1 inFormatEanfy Xh 訕|ylot the students you uant to delete!找不到要?jiǎng)h除的學(xué)生信息計(jì)戎.Information maintenance1*1KKMMKMXKM1.create student Tecore file* 卜xxM

20、HjtxxMZ-Add Student Hecordsmmkmkmmmmmmk kw*3.Stuident Pecard to delete* kmkmmmmmM. Anend the student records* 卜“jihhks. Return to preuious menu* *Please correct choice:3Flease enter you wint to delece No. itudncs :12hetliei? ar not t conf iim the deletion number is 12 school InFcrmation (el&te success!eleted data:Io. Studies Nme No claccc Tlw f ipet cubjiec TI10 cecondTh third cubjctfluerage Total刪除了學(xué)號為12的學(xué)生信息lave* found Che Infopitiait ion you ua.nttudent4o. of neu students enter school:12Students enter a neu nane:vyjWq of new students enter schoo1

溫馨提示

  • 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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論