學生成績管理系統(tǒng)報告_第1頁
學生成績管理系統(tǒng)報告_第2頁
學生成績管理系統(tǒng)報告_第3頁
學生成績管理系統(tǒng)報告_第4頁
學生成績管理系統(tǒng)報告_第5頁
已閱讀5頁,還剩35頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、鏈表的學生管理系統(tǒng)報告1. 需求分析1.1 開發(fā)背景學生信息管理系統(tǒng)是針對學校人事處的大量業(yè)務(wù)處理工作而開發(fā)的管理軟件,主要用于學校學生信息管理,總體任務(wù)是實現(xiàn)學生信息關(guān)系的系統(tǒng)化、科學化、規(guī)范化和自動化,其主要任務(wù)是用計算機對學生各種信息進行日常管理,如查詢、修改、增加、刪除等。學生信息檔案的管理對于學校的管理者來說至關(guān)重要,學生信息是高等學校非常重要的一項數(shù)據(jù)資源,是一個教育單位不可缺少一部分。隨著科學技術(shù)的不斷提高,計算機科學與技術(shù)日漸成熟,計算機應用的普及已進入人類社會生活的各個領(lǐng)域,并發(fā)揮著越來越重要的作用。這種傳統(tǒng)的手工管理模式必然被以計算機為物質(zhì)基礎(chǔ)的信息管理方法所取代。使用計算

2、機對學生檔案進行管理,有著手工管理所無法比擬的優(yōu)點,如:檢索迅速、查找方便、可靠性高、存儲量大、保密性好、壽命長、成本低等。這些優(yōu)點能夠極大地提高學生檔案管理的效率,也是學校向科學化、正規(guī)化管理發(fā)展的必要條件,更是各個高等院校與世界接軌的重要條件。1.2數(shù)據(jù)需求學生管理系統(tǒng)能實現(xiàn)對大量的學生信息的管理處理,其中記錄了學生的學號,姓名,性別,出生日期,各科成績等。首先學號為字符型長度為十七位,姓名為字符串型長度為十七位,性別為字符型,female為女,male為男,出生年月日為整型,例如出生年為1995,出生月為6,出生日為30,各科成績?yōu)閷嵭汀?.3功能性需求本程序可對學生管理系統(tǒng)的學生信息進

3、行增、刪、改、查、排序、統(tǒng)計、保存入文件和從文件讀取數(shù)據(jù)等操作。2. 概要設(shè)計2.1流程程序執(zhí)行的命令包括:(1)錄入(2)讀取信息(3)存入數(shù)組(4)平均分或某課成績排序(5)姓名或?qū)W號順序輸出(6)按照年齡和性別查找(7)查找平均分排名及成績(8)查找某課最高成績(9)查找某課成績分數(shù)段內(nèi)(10)統(tǒng)計人數(shù)及百分比(11)修改學生信息(12)刪除學生信息(13)插入學生信息(0)退出系統(tǒng)菜 單信息查詢統(tǒng)計信息錄入輸出信息維護更新信息修改信息刪除信息增加信息錄入信息讀取入放入數(shù)組排序查找圖2-1 流程圖圖2-2 主菜單2.2測試數(shù)據(jù)學號 姓名性別出生日期數(shù)學成績語文成績英語成績1001sufe

4、male3456771002kaimale7090891003taofemale8090701004beimale99100791005bingmale9090901006yafemale6050661007geefemale88991001008fanfemale6655401009lilimale9084621010sangmale70801003. 詳細設(shè)計 3.1平均分或某課成績輸出學生信息分程序菜單選項數(shù)學、語文、英語和平均分,選擇按哪個科目進行排序,排序時用的是冒泡排序,依據(jù)選擇的學科成績由大到小排序,排序好了就將信息輸出出來。3.2查找某課最高成績注意最高成績可能不止一人。該分程

5、序建立在選擇科目對成績進行從大到小排序的基礎(chǔ)上。首先在分程序菜單中選擇要查詢的科目,然后對該科目的成績進行從大到小的排序,令第一個為最高成績,輸出學生信息,判斷接下來的成績是否等于最高成績,若等于最高成績輸出該學生信息。3.3刪除學生信息輸入需刪除的學生學號,輸出該學生信息,使當前信息開始被下一學生信息覆蓋,存儲信息個數(shù)減少。3.4插入學生信息 學生信息存儲個數(shù)增加,將新增信息保存至數(shù)組最后。4. 測試運行測試運行1:主菜單界面 圖4-1 測試運行2:錄入學生信息圖4-2測試運行3:讀取信息圖4-3測試運行4:平均分或某課成績排序輸出圖4-4平均分排序輸出 測試運行5:姓名或?qū)W號順序輸出圖4-

6、5 按姓名查找 測試運行:6:按年齡和性別查找圖4-6 按年齡查找測試運行7:查找平均分排名及成績圖4-7 測試運行8:查找某課最高成績圖4-8測試運行9:查找某課成績分數(shù)段內(nèi)圖4-9 測試運行11:修改學生信息圖4-11 測試運行12:刪除學生信息圖4-12 測試運行13:插入學生信息圖4-13測試運行14:退出系統(tǒng)圖4-145. 總結(jié)展望5.1總結(jié)通過對學生管理系統(tǒng)的設(shè)計,我體會到了高級語言的靈活性。并且通過這個作業(yè)我了解到自己所掌握的知識是遠遠不夠的!要編出完美的代碼需要自己下去看各種參考資料加上自己的思考。5.2展望 該系統(tǒng)還可在多方面加以拓展: (1)登錄,可設(shè)置用戶名和密碼。(2)

7、 插入學生信息時,若已有相同的學號存在,則不允許再插入相同的學號的學生信息。(3) 修改學生信息時,可提示,讓用戶選擇要更改姓名、還是學號、還是成績。而不要默認讓用戶把這個人的信息全部重新輸入。修改學號時同樣要注意不能出現(xiàn)重復學號(4) 還可在錄入學生信息時增加學院、專業(yè)、民族等信息。6. 參考文獻1 趙致琢.劉坤起等,高級語言程序設(shè)計,國防工業(yè)出版社,2010年2 趙占芳.劉坤起,高級語言程序設(shè)計實驗教程,電子工業(yè)出版社,2014年7. 源代碼清單* Auther:sunxiaoying Number:4 Name:Studentmanagement Function:學生成績管理

8、系統(tǒng)(數(shù)組) Date:2014_12_25 *program stumanagement;$APPTYPE CONSOLEuses definition in 'definition.pas', inputoutput in 'inputoutput.pas', sortfind in 'sortfind.pas', service in 'service.pas', menu in 'menu.pas' begin /主程序 mainmenu; readln;end. /定義unit definition;in

9、terfacetype subject=(math,chinese,english,average); /成績類型 inf=(name,number); student=record infor:arrayname.numberof string17; sex:string10; year:integer; month:integer; day:integer; score:arraymath.average of real; end; stuarr=array 1.30of student ; s of student;Var stu:stuarr; stu; /文件變量 n,result,

10、counter:integer;implementationEnd./菜單 unit menu;interface uses definition,inputoutput,sortfind,service; procedure mainmenu;implementationprocedure mainmenu;begin /主程序 writeln('*歡迎使用學生成績管理系統(tǒng)*'); while true do begin writeln('*'); writeln(' '); writeln(' 菜單: '); writeln(

11、' '); writeln(' 1 錄入 '); writeln(' 2 讀取信息 '); writeln(' 3 存入數(shù)組 '); writeln(' 4 平均分或某課成績排序 '); writeln(' 5 姓名或?qū)W號順序輸出 '); writeln(' 6 按照年齡和性別查找 '); writeln(' 7 查找平均分排名及成績 '); writeln(' 8 查找某課最高成績 '); writeln(' 9 查找某課成績分數(shù)段內(nèi) 

12、9;); writeln(' 10 統(tǒng)計人數(shù)及百分比 '); writeln(' 11 修改學生信息 '); writeln(' 12 刪除學生信息 '); writeln(' 13 插入學生信息 '); writeln(' 0 結(jié)束 '); writeln('請用戶輸入選項:'); readln(n); case n of 1: saveto); 2: outfrom); 3: setuparray(stu); 4: sortbyscore(stu); 5: sortbyorder(stu); 6

13、: findbyns(stu,counter); 7: findbyranking(stu,counter); 8: findbyhighest(stu); 9: findbyrange(stu); 10: count(stu,counter); 11: revise(stu,counter); 12: delete(stu,counter); 13: append(stu,counter); /追加 0:begin ending; break; end; end; end; readln;end;End./錄入輸出 unit inputoutput;interface uses defini

14、tion; procedure saveto stu); procedure outfrom stu); procedure setuparray(var stu stu:stuarr;var counter:integer);implementation功能:將輸入的學生信息保存到文件中 便于多次運行 參數(shù):變參stufile表示學生信息保存地址 procedure saveto stu);Var i,n:integer; sum:real; s:student;begin TODO -oUser -cConsole Main : Insert code here assign(stufil

15、e,'student.dat'); rewrite(stufile); /以寫狀態(tài)打開文件 writeln('請輸入班級人數(shù):'); readln(n); writeln('請輸入學生的信息'); writeln('提示:女:female 男:male'); for i:=1 to n do begin sum:=0; writeln('學號:'); readln(rnumber); writeln('姓名:'); readln(rname); writeln('性別

16、:'); readln(s.sex); writeln('出生日期:'); readln(s.year); readln(s.month); readln(s.day); if 2014-s.year>30 then /判斷日期是否正確 begin writeln('年齡超范圍 輸入錯誤 請重新輸入學生信息'); readln(s.year,s.month,s.day); end else begin case s.month of 1,3,5,7,8,10,12:result:=31; 4,6,9,11:result:=30; 2:if (s.y

17、ear mod 4=0) and (s.year mod 100<>0) or (s.year mod 400=0) then result:=29 else result:=28; end; if s.day>result then begin writeln('輸入期有誤 請重新輸入') ; readln(s.year,s.month,s.day); end; end; writeln('數(shù)學:'); readln(s.scoremath); sum:=sum+s.scoremath; writeln('語文:'); rea

18、dln(s.scorechinese); sum:=sum+s.scorechinese; writeln('英語:'); readln(s.scoreenglish); sum:=sum+s.scoreenglish; writeln('平均分:'); s.scoreaverage:=sum/3; writeln(s.scoreaverage:4:0); write(stufile,s); end; close(stufile);end;功能:非首次運行 從文件中讀取已保存學生信息 參數(shù):變參stufile表示學生信息保存地址 procedure outfro

19、m stu);Var s:student;begin assign(stufile,'student.dat'); reset(stufile); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); writeln('_'); while not eof(stufile) do begin read(stufile,s); writeln(rnumber,#9,rname,#9,s.sex,#9,s.year:8,s.month:4,s.day:4,s.scoremath:8:0,s.scorec

20、hinese:8:0,s.scoreenglish:8:0,s.scoreaverage:8:0); end; close(stufile);end;功能;將原始數(shù)據(jù)保存到數(shù)組stu中 參數(shù):變參stufile表示學生信息保存地址,變參stu表示數(shù)組,變參counter表示存儲學生信息個數(shù)procedure setuparray(var stu stu:stuarr;var counter:integer);begin counter:=0; /數(shù)組存儲學生信息個數(shù) assign(stufile,'student.dat'); reset(stu以讀狀態(tài)打開文件 while n

21、ot eof(stufile) do begin counter:=counter+1; read(stucounter);/每讀出一個數(shù)據(jù),放入數(shù)組中 end; close(stufile);end;End./排序查找統(tǒng)計 unit sortfind;interface uses definition; procedure sortbyscore(var stu:stuarr); procedure sortbyorder(var stu:stuarr ); procedure findbyns(var stu:stuarr;var counter:integer); procedure f

22、indbyranking(var stu:stuarr;var counter:integer) ; procedure findbyhighest(Var stu:stuarr); procedure findbyrange(var stu:stuarr); procedure count(var stu:stuarr;var counter:integer);implementation功能:按照選項對學生信息進行從高到低排序 參數(shù):變參stu表示數(shù)組,枚舉變量sortchoice1表示選擇的排序方式,變量counter表示數(shù)組存儲學生信息個數(shù) procedure sort1( var s

23、tu:stuarr; sortchoice1:subject;var counter:integer);var i,j:integer; temp:student;begin for i:=1 to counter-1 do for j:=1 to counter-i do begin if stuj.scoresortchoice1<stuj+1.scoresortchoice1 then begin temp:=stuj; stuj:=stuj+1; stuj+1:=temp; end; end; writeln('排序結(jié)果為:'); writeln('學號

24、姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); writeln('_'); for i:=1 to counter do begin writeln(rnumber,#9,rname,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); end;end;功能:按照平均分或者某課成績排序輸出 參數(shù):變參stu表示

25、數(shù)組 procedure sortbyscore(var stu:stuarr);var sortnumber:integer;begin writeln('1 math'); writeln('2 chinese'); writeln('3 english'); writeln('4 average'); writeln('選擇排序方式:'); readln(sortnumber); case sortnumber of 1: sort1(stu,math,counter); 2: sort1(stu,chine

26、se,counter); 3: sort1(stu,english,counter); 4: sort1(stu,average,counter); end;end;功能:按照選項將學生信息從小到大進行排序 參數(shù):變參stu表示數(shù)組,枚舉變量sortchoice1表示選擇的排序方式,變量counter表示數(shù)組存儲學生信息個數(shù) procedure sort2(var stu:stuarr; sortchoice2:inf;var counter:integer); /從小到大排序var i,j:integer; temp:student;begin for i:=1 to counter-1 d

27、o for j:=1 to counter-i do begin if rsortchoice2>stuj+1.inforsortchoice2 then begin temp:=stuj; stuj:=stuj+1; stuj+1:=temp; end; end; writeln('排序結(jié)果為:'); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); writeln('_'); for i:=1 to counter do begin writeln(rnumber,#9,s

28、rname,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); end;end;功能:按照姓名或者學號排序輸出 參數(shù):變參stu表示數(shù)組procedure sortbyorder(var stu:stuarr );var sortnumber:integer;begin writeln('選擇排序方式:'); writeln('1 姓

29、名'); writeln('2 學號'); readln(sortnumber); case sortnumber of 1: sort2(stu, name, counter); 2: sort2(stu, number, counter); end;end;功能:按照年齡或性別查找學生信息 參數(shù):變參stu表示數(shù)組,變量counter表示數(shù)組存儲學生信息個數(shù)procedure findbyns(var stu:stuarr;var counter:integer);var x,findnumber,i:integer; y:string;begin writeln(

30、'選擇查找方式:'); writeln('1 年齡 '); writeln('2 性別'); readln(findnumber); case findnumber of 1: begin write('請輸入出生年份:'); readln(x); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); for i:=1 to counter do begin if x=stui.year then begin writeln(rnumber,#9,rnam

31、e,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); break; end; end; end; 2: begin write('請輸入性別:'); readln(y); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); for i:=1 to counter do begin if y=stui.sex the

32、n begin writeln(rnumber,#9,rname,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); break; end; end; end; end;end;功能:查找平均分排名及成績 參數(shù):變參stu表示數(shù)組,變量counter表示數(shù)組存儲學生信息個數(shù) procedure findbyranking(var stu:

33、stuarr;var counter:integer) ;var i,j:integer; temp:student; num:string;begin writeln('請輸入需要查找平均分排名和成績的學生學號:'); readln(num); for i:=1 to counter-1 do for j:=1 to counter-i do begin if stuj.scoreaverage<stuj+1.scoreaverage then begin temp:=stuj; stuj:=stuj+1; stuj+1:=temp; end; end; writeln

34、('平均分總排名:'); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); writeln('_'); for i:=1 to counter do begin writeln(rnumber,#9,rname,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0);

35、end; writeln('_'); for i:=1 to counter do begin if num=rnumber then begin writeln('該同學的平均分排名為:',i) ; writeln('成績?nèi)缦拢?#39;); writeln(' 數(shù)學 語文 英語 平均分'); writeln(stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); break; end; end;end

36、;功能:查找最高成績 參數(shù):變參stu表示數(shù)組,變量counter表示數(shù)組存儲學生信息個數(shù),枚舉變量subjectchoice表示選擇的科目procedure part(var stu:stuarr;subjectchoice:subject;var counter:integer);var i:integer ; highest:real;begin writeln('成績最高的學生信息:'); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); writeln('_'); writeln(rnumb

37、er,#9,rname,#9,stu1.sex,#9,stu1.year:8,stu1.month:4,stu1.day:4,stu1.scoremath:8:0,stu1.scorechinese:8:0,stu1.scoreenglish:8:0,stu1.scoreaverage:8:0); highest:=stu1.scoresubjectchoice; for i:=2 to counter do begin if stui.scoresubjectchoice=highest then begin writeln(rnumber,#9,stui

38、.inforname,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); end; if stui.scoresubjectchoice<highest then begin break ; end; end;end;功能:選擇科目 輸出該科目最高成績 參數(shù):變參stu表示數(shù)組 procedure findbyhighest(Var stu:stuarr);var f

39、indnumber:integer;begin writeln('選擇查找方式:'); writeln('1 math'); writeln('2 chinese'); writeln('3 english'); writeln('請輸入選擇的科目'); readln(findnumber); case findnumber of 1:begin sort1(stu,math,counter); part(stu,math,counter); end; 2:begin sort1(stu,chinese,count

40、er); part(stu,chinese,counter); end; 3:begin sort1(stu,english,counter); part(stu,english,counter); end; end;end;功能:查找成績范圍 參數(shù):枚舉變量subjectchoice表示選擇的科目,變參stu表示數(shù)組,變量counter表示數(shù)組存儲學生信息個數(shù)procedure range(var stu:stuarr;subjectchoice:subject;var counter:integer);var i: integer; mindata,maxdata:real;begin w

41、riteln('輸入查找范圍的最小值'); readln(mindata); writeln('輸入查找范圍的最大值') ; readln(maxdata); writeln('學號 姓名 性別 出生日期 數(shù)學 語文 英語 平均分'); writeln('_'); for i:=1 to counter do begin if (stui.scoresubjectchoice<=maxdata) and (stui.scoresubjectchoice>=mindata) then begin writeln(stui

42、.infornumber,#9,rname,#9,stui.sex,#9,stui.year:8,stui.month:4,stui.day:4,stui.scoremath:8:0,stui.scorechinese:8:0,stui.scoreenglish:8:0,stui.scoreaverage:8:0); end; end;end;功能:選擇科目 輸出該科目分數(shù)段內(nèi)的學生信息 參數(shù):變參stu表示數(shù)組 procedure findbyrange(var stu:stuarr); / 分數(shù)段var findnumber:integer;begin writeln(&

43、#39;選擇查找方式:'); writeln('1 math'); writeln('2 chinese'); writeln('3 english'); writeln('請輸入選擇的科目'); readln(findnumber); case findnumber of 1:range(stu,math,counter); 2:range(stu,chinese,counter); 3:range(stu,english,counter); end;end;功能:統(tǒng)計單門課程各個類別的人數(shù)及百分比 參數(shù):變參stu表示數(shù)組,變量counter表示數(shù)組存儲學生信息個數(shù),枚舉變量sortchoice表示選擇科目類型procedure percent(var stu:stuarr;sortchoice:subject;var counter:integer) ;var i:integer; excellen

溫馨提示

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

評論

0/150

提交評論