C++課程設計--學校人員信息管理系統(tǒng)報告_第1頁
C++課程設計--學校人員信息管理系統(tǒng)報告_第2頁
C++課程設計--學校人員信息管理系統(tǒng)報告_第3頁
C++課程設計--學校人員信息管理系統(tǒng)報告_第4頁
C++課程設計--學校人員信息管理系統(tǒng)報告_第5頁
已閱讀5頁,還剩18頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、C+課程設計報告課程設計題目:學校人員信息管理系統(tǒng)第一部分1. 目的及要求目的:要求學生達到熟練掌握C卄語言的基本知識和技能,基本掌握面向?qū)?象程序設計的基本思路和方法,并且能夠利用所學的基本知識和技能,解決簡單 的面向?qū)ο蟪绦蛟O計問題.要求:利用面向?qū)ο蟮姆椒ㄒ约癈+的編程思想來完成系統(tǒng)的設計;要求 在設計的過程中,建立清晰的類層次;在系統(tǒng)設計中要分析和定義各個類,每 個類中要有各自的屬性和方法;在系統(tǒng)的設計中,要求運用面向?qū)ο蟮臋C制(繼 承、派生及多態(tài)性)來實現(xiàn)系統(tǒng)功能.2. 設計題目描述用C+設計一個大學教師和學生管理程序,教師包括編號(a),姓名(c),職稱(d)和教研室數(shù)據(jù)(b)的數(shù)

2、據(jù)輸入輸出;大學生包括編號(m),姓名(s),性別(t), 班號(n),英語(e),高等數(shù)學(f)和數(shù)據(jù)結(jié)構(gòu)(g)三門課程成績輸入輸出和計算機 平均分(ave):研究生包括編號,姓名,性別,班號,指導教師和研究方法數(shù)據(jù)輸入 輸出;傅士后數(shù)據(jù)的輸入輸出;博士后既是教師也是研究生.(用派生,繼承的方 法可以做)3. 解決方案及設計思路根據(jù)系統(tǒng)功能要求,可以將問題解決分為以下步驟:(1) 應用系統(tǒng)分析,建立該系統(tǒng)的功能模塊框圖以及界面的組織和設計;(2) 分析系統(tǒng)中的各個實體及它們之間的關系包括屬性和行為;(3)根據(jù)問題描述,設計系統(tǒng)的類層次;(4)完成類層次中各個類的描述(包括屬性和方法);(5)

3、完成類中各個成員函數(shù)的定義;(6)完成系統(tǒng)的應用模塊;(7)功能調(diào)試;4. 系統(tǒng)分析與設計(1)系統(tǒng)功能模塊圖:圖4T系統(tǒng)功能模塊圖1)信息錄入功能模塊:信息錄入模塊是簡單成績管理系統(tǒng)首先要執(zhí)行的一 個基本模塊.該模塊的功能即教師、大學生、研究生、t専士后的各項數(shù)據(jù)的輸入, 只有當數(shù)據(jù)存入才能進行其他的功能.教師包括:編號,姓名,職稱和教研室數(shù)據(jù),大學生包括:編號,姓名,性別,班號,英語,高等數(shù)學和數(shù)據(jù)結(jié)構(gòu), 研究生包括:編號,姓名,性別,班號,指導教師和研究方法,博士后包括:編號,姓名,性別,班號,指導教師,研究方法,職稱和教 研室數(shù)據(jù).2)信息修改功能模塊:實現(xiàn)已錄入信息的修改,用新輸入的

4、信息覆蓋原來 的信息.3)信息刪除功能模塊:通過編號刪除己錄入的成員信息.4)信息查詢功能模塊:通過編號查找己錄入的成員信息.5)求平均分功能模塊:該功能求出大學生英語、高等數(shù)學、數(shù)據(jù)結(jié)構(gòu)三門 的平均分.6)成績排序功能模塊:該功能實現(xiàn)大學生英語、高等數(shù)學、數(shù)據(jù)結(jié)構(gòu)和總 分的排序,此處用冒泡排序法實現(xiàn).(2)系統(tǒng)主函數(shù)流程圖:出現(xiàn)歡迎界Y顯示菜單用戶輸入根據(jù)輸入執(zhí)行相應的操結(jié)束畫(3)類的層次圖4-2主函數(shù)流程圖a, c, d, b, inputl (), input2 (), outpm, s, t, n, e, f, g, z, input3 (), inpuutl (), output2

5、 (), change (), deletet4 (), output3 (), output4 (), changteacherundergraduate圖4-3類的層次圖其中:1) teacher類的a-編號,c-姓名,d-職稱,b-教研室數(shù)據(jù),input 1 () 為輸入編號和姓名的成員函數(shù),input2()為輸入職稱和教研室數(shù)據(jù)的成員 函數(shù),output 1 ()為輸出編號和姓名的成員函數(shù),output2 ()為輸出職稱和 教研室數(shù)據(jù)的成員函數(shù),changeO為修改教師資料數(shù)據(jù)的成員函數(shù), delete ()為刪除教師資料數(shù)據(jù)的成員函數(shù),search ()為查找教師資料數(shù)據(jù) 的成員函數(shù)

6、.2) undergraduate類的m-編號,s-姓名,t-性別,n-班號,e-英語成 績,f_高等數(shù)學成績,g-數(shù)據(jù)結(jié)構(gòu)成績,z-總分,input3()為輸入編號、 姓名性別和班號的成員函數(shù),input4()為輸入英語、高等數(shù)學和數(shù)據(jù)結(jié)構(gòu) 成績的成員函數(shù),output3()為輸出編號、姓名性別和班號的成員函數(shù), output4()為輸出英語、高等數(shù)學和數(shù)據(jù)結(jié)構(gòu)成績的成員函數(shù),change ()為 修改大學生資料數(shù)據(jù)的成員函數(shù),delete ()為刪除大學生資料數(shù)據(jù)的成員 函數(shù),search ()為查找大學生資料數(shù)據(jù)的成員函數(shù),getnumQ為求得錄入大學生人數(shù)個數(shù)的成員函數(shù).3) grad

7、uate_student類的director-指導教師,method-研究方法, input5 ()為輸入指導教師和研究方法的成員函數(shù),output5 ()為輸出指導教 師和研究方法的成員函數(shù).graduate_student類是undergraduate類的繼 承,繼承了其m-編號,s-姓名,t-性別,n-班號.4) postdoctoral類繼承 j" teacher類和Igraduate_student類.第二部分1. 調(diào)試過程歡迎您矗見學昭員信息管理系統(tǒng)哼璽啤里色堂坐-二獻正確,請按任意鍵進入系統(tǒng)?學校人員信息管理系統(tǒng)D1.師生資料錄入3.師生資料刪除5.顯示師生資料?學生成

8、績排名2 2 2 2 2 2 2 2 2 2 2 2 2.師生資料修改4.師生資料査詢6.學生成績均分8.退岀系統(tǒng)請輸入您的選擇(18):.名名名名一績績績績-4 成成成成單 辜構(gòu)分菜 數(shù)結(jié)主巧 等據(jù)回(1 英高數(shù)總飯圣 4J1 2 3 4 5 先- _ M _ 爾3 _ _ _ _-V 一 一 一 一 一 刖 一一 一一一 M 冃 _ 請 號號 Ti T1名名- 塑塑0. ;返 0 0握 :意 號號任 扁扁安學校人員信息管理系統(tǒng)B帀生資料錄入2.師生資料修改3.師生資料刪除4.師生資料查詢5.顯示師生資料6.學生成績均分化學生成績排名8.退岀系統(tǒng)57( 8擇八2刀 選霧均 的分平平 你対學構(gòu)

9、 入平數(shù)結(jié) 輸語等據(jù)- 遣央高數(shù)2. 部分關鍵代碼大學生資料修改的函數(shù)代碼void Change(undergraduate u, int system("cls);int choice;char number20, name20, sex, clas20, c; float English, math, date;COUt«,/請輸入要修改的大學生的編號:; cin>>number;for (int i=0:i<i2:i+) if (strcmp (u i m, number) =0)cout<"1.編號2.姓名,<<endl

10、;cout<"3.性別4.班號,<<endl;cout<"5.英語成績6.高等數(shù)學成績"endl;cout<<,z7.數(shù)據(jù)結(jié)構(gòu)成績,z<<endl;doCOUt«,Z請選擇要修改的項目:; cin>>choice;while(!(choice>=l&&choice<=7)COUt«,Z輸入錯誤,請重新輸入:; cin>>choice;if (choice=l)COUt«,/請輸入修改后的編號:; cin>>number;st

11、rcpy (ui. m, number);if (choice=2)cout«/z請輸入修改后的姓名:;cin>>name;strcpy(ui. s, name);if (choice=3)COUt«,/請輸入修改后的性別:; cin>>sex;ui.t二sex;if (choice=4)COUt«,/請輸入修改后的班號:; cin>>clas;strcpy (ui. n, clas);if (choice=5)COUt«,/請輸入修改后的英語成績:"; cin>>English;ui.e=Eng

12、lish;if (choice=6)COUt«,/請輸入修改后的高等數(shù)學成績:; cin>>math;ui.f二math;if(choice=7)COUt«,/請輸入修改后的數(shù)據(jù)結(jié)構(gòu)成績:; cin>>date;ui.g二date;cout«endl;cout«,z資料修改成功!是否繼續(xù)修改?(Y/N):; cin»c;while (c!= Y'&ftc!二'N')cout«,z輸入錯誤,請重新輸入:; cin>>c; while (c二二'Y');b

13、reak;if(i=i2)cout«,/無此大學生的資料! "<endl;cout«,/按任意鍵返回.;getch();教師資料刪除的函數(shù)代碼void Delete(teacher t,int *dl)system("cls);teacher tt;int r二*dl:char number20:COUt«,/請輸入要刪除的教師的編號:";cin>>number;cout«endl;for (int i=0;i<r;i+)if (strcmp(t i a, number) =0)for (int j=

14、i;j<r;j+)cout<"編號zz«number<</,的教師的資料已刪除! "endl; break;if(i=r)cout«z/無此教師的資料!z,«endl;學生成績排名代碼void sort (undergraduate u,int *d2) int a;dosystem(cls");cout«- 1.英語成績排名-i-<<endl;cout- 2.冋守數(shù)學成績排名-一-<<endl;cout- 3.數(shù)據(jù)結(jié)構(gòu)成績排名一-<<endl;cout- 4.總分

15、成績排名-一-<<endl;cout«-5.返回主菜單 -一-<<endl;cout«z,請輸入您的選擇(1、5): ; cin»a;if(a<l|a>5)cout«輸入錯誤,請重新輸入! ”;if(a=l)undergraduate s;for (int i=0:i<*d2;i+)for (int j=0;j<*d2i;j+)if (ujl. euj+l e)S=uj;uj二 uj+l; uj+l=s;for(i=0;i<*d2;i+)cout<<z,編號:"setw(3) &

16、#171;ui.姓名:"<<setw(4)<<ui. s«z/ 班號:"<<ui. n«endl;cout«endl;cout«,/按任意鍵返回getch();if(a=2)if(a=3)if (a=4)while(a!=5);主函數(shù)void main ()char c:int i,m=0;char b7;歡迎您使用學校人員信息管理系統(tǒng)管理人:賴玉蕾,z«endl;char pass7="111111"cout<",<<endl;cout&l

17、t;<,/COUt<<,Zb卜卜卜卜卜卜卜卜卜卜卜尢卜*endl;cout«請輸入6位密碼登錄:;for(i=0;i<6;i+)c=getch();bi=c;cout«*;getchO ;b6= Oif (strcmp(pass, b)!=0)m+;cout«endl«z/密碼輸入錯誤,請重新輸入,您還有3-ni«次機會 elsecout<<endl<<z/輸入正確,請按任意鍵進入系統(tǒng) !,<<endl:getchO ;break;while(m<3);if(m>=3)sy

18、stem("cls); cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl; cout«,zttt連續(xù)三次輸入錯誤,強制退出程序!,z«endl;exit (0);teacher t20;undergraduate u20;graduate_student g20;postdoctoral p 20:int ch, a, il=0, i2=0, i3=0, i4=0, j;int *dl=&a

19、mp;il, *d2二&i2, *d3二&i3, *d4=&i4;char choice;dosystem(cls);menul ();cout«,z請輸入您的選擇(廣8):cin»ch;while(! (ch>=l&&ch<=8)cout«輸入錯誤,請重新輸入:; cin>>ch;switch(ch)case 1:dosystem("cls");menu2 ();cout«"請輸入您的選擇(T5): cin>>a;while(!(a>=l&a

20、mp;&a<=5)cout«/z輸入錯誤,請重新輸入:; cin>>a;if (a=l)dosystem(,cls,/); cout«/,請輸入教師信息:z/«endl; t ill. inputl ();t il. input2(); cout<<endl;cout«,z是否繼續(xù)錄入?(Y/N): cin>>choice;while (choice !=,Y' &&choice !=,N') cout«,/輸入錯誤,請重新輸入 cin>>choice

21、;il+; while (choice=,Y');if(a=2)dosystem("cis"); cout«/,請輸入大學生信息:"<endl;ui2. input3();ui2. input4();cout<<endl;cout«是否繼續(xù)錄入?(Y/N): cin>>choice;while (choice !=,Y' &&choice !=,N')COUt«,/輸入錯誤,請重新輸入:; cin>>choice;i2+; while (choice二二

22、'Y');if(a=3)dosystem("cis");cout«/,請輸入研究生信息:"<endl; gi3. input3();gi3. input5();cout<<endl;cout«是否繼續(xù)錄入?(Y/N): cin»choice;while (choice !=,Y' &&choice !=,N')COUt«,/輸入錯誤,請重新輸入:; cin>>choice;i3+; while (choice二二'Y');if (a

23、=4)dosystem("cis");cout«/,請輸入博士后信息:"<endl;pi4. input3 ();pi4. input2 ();pi4. input5 ();cout<<endl;cout«是否繼續(xù)錄入?(Y/N): cin>>choice;while (choice !=,Y" &&choice !=,N')COUt«Z,輸入錯誤,請重新輸入:; cin>>choice; i4卄; while (choice=,Y');while (

24、a!=5);break;case 2:dosystem("cls");cout«/,資料修改.,«endl;coutendl;menu2 ();cout«"請輸入您的選擇(T5): ”、 cin>>a;while(!(a>=l&&a<=5)cout«/z輸入錯誤,請重新輸入 cin>>a;if (a=l) Change (t, i 1);if (a=2) Change(u, i2);if (a=3) Change(g,i3);if (a=4) Change(p, i4);)

25、while(a!=5);break;case 3:dosystem("cls");cout«,z資料刪除.,«endl;coutendl;menu2 ();cout«"請輸入您的選擇(T5): ”、 cin>>a;while(!(a>=l&&a<=5)cout«/z輸入錯誤,請重新輸入 cin>>a;if (a=l) Delete (t, dl):if (a=2) Delete (u,d2):if (a=3) Delete(g, d3): if(a=4) Delete (p

26、, d4); if(!(a=5) COUt«,/按任意鍵返回."; getch();while (a!=5);break;case 4:do system("cls"); cout<<"資料查詢.,<<endl; coutendl;menu2 ();cout«"請輸入您的選擇(T5): cin>>a;while (!(a>=l&&a<=5) cout«/z輸入錯誤,請重新輸入 cin>>a;if (a=l) Search (t, i 1);

27、if (a=2) Search (u, i2):if (a=3) Search(g, i3): if(a=4) Search (p,i4); if(!(a=5)COUt«,/按任意鍵返回."; getch();while (a!=5);break;case 5:system("cls"); cout<<,z教師信息:"<<endl; if(*dl=O)cout<"暫無!"endl;for (j=0;j<*dl;j+)t j. outputl (); t j. output2 (); cou

28、endl;cout«endl; cout<</,大學生信息:"endl;if (*d2=0)cout"暫無!"endl;for(j=0;j<*d2;j+)uj output3(); uj output4(); cout<<endl;cout«endl;cout<</,研究生信息:"endl; if (*d3=0)cout"暫無!"endl;for (j=0;j<*d3;j+)gj output3();gj output5(); cout<<endl;cout«endl; cout«"博士后信息:"endl;if (*d4=0)cout"暫無!"endl;for(j=0;j<*d4;j+)pj outpu

溫馨提示

  • 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

提交評論