C++課程設(shè)計報告(學(xué)生學(xué)籍管理系統(tǒng))_第1頁
C++課程設(shè)計報告(學(xué)生學(xué)籍管理系統(tǒng))_第2頁
C++課程設(shè)計報告(學(xué)生學(xué)籍管理系統(tǒng))_第3頁
C++課程設(shè)計報告(學(xué)生學(xué)籍管理系統(tǒng))_第4頁
C++課程設(shè)計報告(學(xué)生學(xué)籍管理系統(tǒng))_第5頁
已閱讀5頁,還剩13頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上 學(xué)生學(xué)籍管理系統(tǒng) 【摘要】 學(xué)籍管理系統(tǒng)設(shè)計涉及學(xué)生信息的錄入,顯示,查找,刪除,修改,統(tǒng)計,保存,退出等功能,從而能夠?qū)π畔⑦M(jìn)行處理。程序中運用了相關(guān)類的知識,同時定義了一定數(shù)量的數(shù)據(jù)及成員函數(shù)。程序使用了數(shù)組記錄統(tǒng)計的相關(guān)數(shù)據(jù),運用了指針實現(xiàn)相應(yīng)功能函數(shù)的功能,運用了student ,school兩個類實現(xiàn)面向?qū)ο蟮囊?。程序的完成涉及到程序的分析,模塊的分解,程序的控制,程序的調(diào)試?!娟P(guān)鍵詞】 學(xué)籍管理 vc+6.0 面向?qū)ο?程序控制 類第1章 概述1.1 系統(tǒng)實現(xiàn)的目標(biāo) 課程設(shè)計的任務(wù): 制作一個小型的學(xué)生學(xué)籍管理系統(tǒng),要求制作一個菜單,實現(xiàn)數(shù)據(jù)的錄入,數(shù)

2、據(jù)的顯示,數(shù)據(jù)查找,數(shù)據(jù)的刪除,數(shù)據(jù)的保存,數(shù)據(jù)的統(tǒng)計,數(shù)據(jù)的修改,系統(tǒng)的退出。系統(tǒng)的設(shè)計要求用到C+面向?qū)ο蟮某绦蛟O(shè)計,要求用到類來實現(xiàn),同時每一個功能用到一個函數(shù)。基本功能:學(xué)生基本信息(編號,姓名,性別,籍貫,民族,生日,政治面貌,省份證,數(shù)學(xué)成績,英語成績,計算機(jī)成績)成績統(tǒng)計(各科總成績,各科平均成績,各科的及格率)擴(kuò)展功能:學(xué)生數(shù)據(jù)的添加、修改、與刪除學(xué)生數(shù)據(jù)的讀取與存儲 系統(tǒng)特點:系統(tǒng)要能夠?qū)ο鄳?yīng)的數(shù)據(jù)進(jìn)行很好的測試,系統(tǒng)的統(tǒng)計對每一科的總成績,平均成績,及格律都進(jìn)行了統(tǒng)計;系統(tǒng)數(shù)據(jù)的錄入 除可以手工錄入外,還可以采用文件的錄入;系統(tǒng)統(tǒng)計學(xué)生的基本信息較全面,包括學(xué)號,姓名,民族

3、,政治面貌,身份證號,生日,性別,數(shù)學(xué)、英語、計算機(jī)的成績;程序中查找運用了兩種查找方式即學(xué)號查找和姓名查找。1.2 系統(tǒng)實現(xiàn)方案第一步:分析題目,建立類并派生出它的子類,畫出類圖。 第二步:畫出流程,根據(jù)流程圖編寫程序清單 第三步:上機(jī)調(diào)試程序(使用單步調(diào)試,設(shè)置斷點、分塊調(diào)試的方法)。 第五步:及時整理資料,撰寫課程設(shè)計報告中有關(guān)這個題目的內(nèi)容。 1.3 系統(tǒng)實現(xiàn)環(huán)境硬件配置:586以上PC兼容機(jī)或品牌機(jī),配有彩色顯示器、鼠標(biāo)、鍵盤,內(nèi)存不小于64MB,硬盤自由空間不少于200MB。推薦配置為內(nèi)存128MB或256MB(或以上),硬盤自由空間500MB以上。操作系統(tǒng):Windows2000

4、/NT/Xp、Visual C+集成開發(fā)環(huán)境。第2章 系統(tǒng)分析2.1 調(diào)查程序?qū)W(xué)生學(xué)籍的數(shù)據(jù)處理要求 能夠輸入并瀏覽學(xué)生的基本信息; 能夠?qū)崿F(xiàn)對學(xué)生信息的查詢和修改; 能夠?qū)Τ煽冞M(jìn)行統(tǒng)計; 能夠?qū)W(xué)生的信息進(jìn)行保存;現(xiàn)行的系統(tǒng)功能:資料維護(hù):系統(tǒng)維護(hù)包括對各學(xué)生信息和成績的錄入操作。資料維護(hù):對數(shù)據(jù)表中的信息進(jìn)行瀏覽。系統(tǒng)查詢:可以對不同科目的總成績、不及率、各科平均成績相關(guān)信息。2.2現(xiàn)行系統(tǒng)分析現(xiàn)行系統(tǒng)組織結(jié)構(gòu)圖:開始選擇菜單序號0退出7保存信息6統(tǒng)計成績5修改信息4刪除信息3查找信息2顯示信息1錄入信息選擇修改方式1?按要求逐步輸入學(xué)生信息2?編號查詢保存?輸入學(xué)生信息姓名查找保存退出

5、第3章 系統(tǒng)設(shè)計3.1 系統(tǒng)功能設(shè)計系統(tǒng)功能結(jié)構(gòu)圖:主程序采單程序初始化程序退出輸入顯示查找刪除修改統(tǒng)計3.2 類設(shè)計類:student 數(shù)據(jù)成員編號,姓名,性別,籍貫,民族,生日,政治面貌,省份證,數(shù)學(xué)成績,英語成績,計算機(jī)成績類:school成員函數(shù)錄入函數(shù)Input():輸入編號到計算機(jī)的成績;統(tǒng)計函數(shù)count():統(tǒng)計各科的總成績,計算平均成績,統(tǒng)計各科的及格率;查詢函數(shù)found():按學(xué)號或姓名查找學(xué)生的記錄;修改函數(shù)mend():修改指定學(xué)號學(xué)生成績記錄;刪除函數(shù)del():刪除指定學(xué)號學(xué)生記錄;輸出函數(shù)show():輸出班級所有學(xué)生成績記錄;UML圖:Student#numb

6、er:int#name20:char#sex6:char#place20:char#nation6:char#birth20:char#party10: char#id20:char#score3:float+student*next;       +student()         +student() + * getname():char+getnumber():int+getscore(inti)double+ getg():float+ input():void+input(ifstream & is):

7、void +output():void+output(ofstream&os):voidschool+school()+school()+ input():void+ mend():void+ del():void+ find:int+found():void+ show():void+ count():void+ save():void+ begin():void+ clear():void+mainmenu():char+getkey():int+setkey(intk):void- *head: student - key:int3.3 輸入輸出的設(shè)計1界面的設(shè)計、界面設(shè)計程序運

8、行后會出現(xiàn)一個簡捷的窗口,便于用戶查詢數(shù)據(jù)。、功能設(shè)計通過主窗體調(diào)用其他窗體,具體實現(xiàn)可以參照系統(tǒng)分析相關(guān)內(nèi)容。應(yīng)用系統(tǒng)主控界面包括學(xué)生信息錄入,查找等功能模塊。學(xué)生信息錄入功能完成學(xué)生信息和成績的輸入。記錄查詢功能可以對數(shù)據(jù)各分類的記錄進(jìn)行查詢。2數(shù)據(jù)輸出設(shè)計系統(tǒng)主界面:統(tǒng)計界面:查找界面:顯示界面:錄入界面:修改界面:第4章 系統(tǒng)實現(xiàn)1.代碼#include<iostream.h>#include<string.h>#include<fstream.h>#include<iomanip.h> class student protected:

9、int number; char name20;char sex6; char place20;char nation6; char birth20;char party10; char id20;float score3;public: student *next; student() student() char* getname() return name; int getnumber() return number;double getscore(int i) return scorei;float getg() return (score0+score1+score2); void

10、input() int e=1;cout<<"ttt按提示輸入:"<<endl;cout<<"tt輸入編號: " cin>>number;cout<<"tt輸入姓名: " cin>>name;docout<<"tt輸入性別: " cin>>sex; if(strcmp(sex,"男")=0 | strcmp(sex,"女")=0) cout<<"tt輸入籍貫:

11、 "cin>>place; cout<<"tt輸入民族: "cin>>nation;cout<<"tt輸入生日: "cin>>birth; cout<<"tt輸入政治面貌: "cin>>party; cout<<"tt輸入身份證號: "cin>>id; cout<<"tt輸入數(shù)學(xué)分?jǐn)?shù): "cin>>score0;cout<<"tt輸入

12、英語分?jǐn)?shù): "cin>>score1; cout<<"tt輸入計算機(jī)分?jǐn)?shù): "cin>>score2; e=0; else cout<<"ttt無此類型性別!重新輸入!"<<endl; e=1; while(e); return ;void input(ifstream & is) is>>number>>name>>sex>>place>>nation>>birth>>party>>

13、;id >>score0>>score1>>score2;is.get(); void output()cout<<"學(xué)生基本信息如下:"<<endl; cout<<"編號:"<<number<<" 姓名:"<<name<<" 性別:"<<sex <<" 籍貫:"<<place<<" 民族:"<<n

14、ation<<" 生日:"<<birth<<" 政治面貌:"<<party<<endl<<"身份證號:"<<id<<" 數(shù)學(xué):"<<score0<<" 英語:"<<score1 <<" 計算機(jī):"<<score2<<" 總分:"<<getg()<<endl<&l

15、t;endl;void output(ofstream & os) os<<setw(6)<<number <<setw(15)<<name<<setw(20)<<place <<setw(6)<<nation<<setw(20)<<birth<<setw(20)<<party <<setw(20)<<id<<setw(6)<<score0<<setw(6)<<score1

16、<<setw(6)<<score2<<endl;class school public: school() head=new student; head->next=NULL; key=0; school() delete head; void input(); void mend(); void del();int find(student *p,int num,char *pn="");void found(); void show(); void count();void save(); void begin(); void

17、clear();char mainmenu();int getkey() return key;void setkey(int k) key=k; private: student *head; int key;/錄入函數(shù)void school:input()student *p,*p2=NULL;p=head; int n;while(p->next)p=p->next;while(n) p2=new student; p2->input(); p->next=p2; p2->next=NULL; p=p->next; school:setkey(1);

18、cout<<"ttt按1繼續(xù),按0返回 : " cin>>n; /子查找函數(shù)int school:find(student *p1,int num,char *pn) student *p; p=head;while(p->next) (*p1)=p; if( (p->next)->getnumber()=num|!strcmp( (p->next)->getname(),pn ) ) return 1; p=p->next;return 0; /查找函數(shù)void school:found() student *p

19、;int num=-1,n=9; char name20=""do cout<<"tt1:按編號查找,2:按姓名查找: " cin>>n;while(n<1|n>2);if(n=1) cout<<"ttt輸入編號: " cin>>num;if(n=2) cout<<"ttt輸入姓名: "cin>>name; if(!find(&p,num,name) ) cout<<"tt找不到你要查找的內(nèi)容!&quo

20、t;<<endl;return;(p->next)->output();/刪除函數(shù)void school:del() student *p,*p2; int num;cout<<"ttt輸入編號: " cin>>num;if( !find(&p,num,"") ) cout<<"tt找不到你要刪除的內(nèi)容!"<<endl;return;(p->next)->output();p2=p->next; p->next=p2->nex

21、t;delete p2;school:setkey(1); void school:show() /顯示函數(shù) student *p; p=head;while(p->next) (p->next)->output();p=p->next;/修改函數(shù)void school:mend() student *p; int num=-1,n;char name20=""do cout<<"tt1:按編號修改,2:按姓名修改: " cin>>n;while(n<1|n>2);if(n=1) cout<

22、;<"ttt輸入編號: " cin>>num;if(n=2)cout<<"ttt輸入姓名: "cin>>name;if( !find(&p,num,name) ) cout<<"tt找不到你要修改的內(nèi)容!"<<endl;return;(p->next)->output(); (p->next)->input();school:setkey(1);void school:save() /保存函數(shù) student *p; p=head;ofs

23、tream os("student.txt",ios:out);if (school:getkey()=1) while(p->next) (p->next)->output(os); p=p->next; cout<<"ttt文件已保存! "<<endl;school:setkey(0);void school:begin()/初始化函數(shù) student *p,*p2;p=head; clear();long t;ifstream is("student.txt",ios:in); i

24、f(!is) ofstream os("student.txt",ios:out);os.close();return ;int num=-1;while(1) num=-1; t=is.tellg(); is>>num;is.seekg(t); if(num<0) is.close(); return;p2=new student; p2->input(is);p->next=p2; p2->next=NULL; p=p->next;void school:clear()/清空函數(shù) student *p,*p2;p=head-&g

25、t;next;while( p )p2=p; p=p->next;delete p2;void school:count()/統(tǒng)計函數(shù) student *p; p=head;int n=0;double g3=0,0,0; float j3=0,0,0;while(p->next) p=p->next; n+; for(int i=0;i<3;i+) gi=gi+( p->getscore(i) ); (p->getscore(i) )>=60.0? ji+ : 0 ;cout<<"ttbbbb數(shù)學(xué)總分:"<<

26、;g0<<" 平均分:"<<g0/n<<" 及格率:"<<j0/n<<endl<<"ttbbbb英語總分:"<<g1<<" 平均分:"<<g1/n<<" 及格率:"<<j1/n<<endl<<"ttbbbb計算機(jī)總分: "<<g2<<" 平均分: "<<g2/n<

27、;<" 及格率:"<<j2/n<<endl;/主選菜單函數(shù)char school:mainmenu()char n6;cout<<"nn 歡迎進(jìn)入學(xué)籍管理系統(tǒng)"<<endl<<endl<<" * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl<<" * * * * * * * * * * * * * * * * * * * * * * * * * *

28、* *"<<endl<<" * * 1: 錄入學(xué)生信息 * *"<<endl<<" * * 2: 顯示學(xué)生信息 * *"<<endl<<" * * 3: 查找學(xué)生信息 * *"<<endl<<" * * 4: 刪除學(xué)生信息 * *"<<endl<<" * * 5: 修改學(xué)生信息 * *"<<endl<<" * * 6: 統(tǒng)計學(xué)生成績

29、* *"<<endl<<" * * 7: 保存學(xué)生信息 * *"<<endl<<" * * 0: 退出系統(tǒng) * *"<<endl<<" * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl<<" * * * * * * * * * * * * * * * * * * * * * * * * * * * *"<<endl<<" 請選擇:"cin>>n;return n0;/主函數(shù)void main()school pp;int k=1; char n; pp.begin();while(k=1) n=pp.mainmenu();switch(n) case &#

溫馨提示

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

評論

0/150

提交評論