人員管理系統(tǒng)_第1頁
人員管理系統(tǒng)_第2頁
人員管理系統(tǒng)_第3頁
人員管理系統(tǒng)_第4頁
人員管理系統(tǒng)_第5頁
已閱讀5頁,還剩40頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、C+面向?qū)ο蟪绦蛟O(shè)計 課程設(shè)計報告 課程名稱C+ 面向?qū)ο蟪绦蛟O(shè)計 課題名稱公司人員信息管理系統(tǒng) 專 業(yè) 班 級 學(xué) 號 姓 名 指導(dǎo)教師 2013年12 月 25 日 一)、課程設(shè)計題目 公司人員信息管理系統(tǒng) (二)、目的與要求: 1 、目的: (1)要求學(xué)生達(dá)到熟練掌握 C+語言的基本知識和技能; ( 2)基本掌握面向?qū)ο蟪绦蛟O(shè)計的基本思路和方法; (3)能夠利用所學(xué)的基本知識和技能,解決簡單的面向?qū)ο蟪绦蛟O(shè)計問題。 2、基本要求: (1 )要求利用面向?qū)ο蟮姆椒ㄒ约?C+的編程思想來完成系統(tǒng)的設(shè)計; (2)要求在設(shè)計的過程中,建立清晰的類層次; (3)在系統(tǒng)中至少要定義四個類,每個類中要

2、有各自的屬性和方法; (4)在系統(tǒng)的設(shè)計中,至少要用到面向?qū)ο蟮囊环N機(jī)制。 3、創(chuàng)新要求: 在基本要求達(dá)到后,可進(jìn)行創(chuàng)新設(shè)計,如根據(jù)查找結(jié)果進(jìn)行修改的功能。 (三)、設(shè)計方法和基本原理: 1. 功能要求 ( 1 )添加功能 程序能夠任意添加上述四類人員的記錄,可提供選擇界面供用戶選擇所 要添加的人員類別,要求人員的編號要唯一,如果添加了重復(fù)編號的記錄時,則提示用 戶數(shù)據(jù)添加重復(fù)并取消添加。 ( 2 )查詢功能 可根據(jù)編號、姓名等信息對已添加的記錄進(jìn)行查詢。如果未找到,給出相應(yīng)的提示 信息,如果找到,則顯示相應(yīng)的記錄信息。 ( 3 )顯示功能 可顯示當(dāng)前系統(tǒng)中所有記錄。 ( 4 )修改功能 可根

3、據(jù)查詢結(jié)果對相應(yīng)的記錄進(jìn)行修改,修改時注意編號的唯一性。 ( 5 )刪除功能 對已添加的人員記錄進(jìn)行刪除。如果當(dāng)前系統(tǒng)中沒有相應(yīng)的人員記錄,則提示“記 錄為空!”并返回操作;否則輸入要刪除的人員的編號或姓名,根據(jù)所輸入的信息刪除 該人員記錄,如果沒有找到該人員信息,則提示相應(yīng)的記錄不存在。 (6)統(tǒng)計功能 能根據(jù)多種參數(shù)進(jìn)行人員的統(tǒng)計。例如:統(tǒng)計四類人員數(shù)量以及總數(shù),統(tǒng)計男、女 員工的數(shù)量,統(tǒng)計平均工資、最高工資、最低工資等。 (7)保存功能 將當(dāng)前系統(tǒng)中各類人員記錄存入文件中。 (8)讀取功能 將保存在文件中的人員信息讀入到當(dāng)前系統(tǒng)中,以供用戶使用。 在完成以上基本功能的基礎(chǔ)上,可自行進(jìn)行擴(kuò)

4、展或完善。 2 、問題的解決方案: 根據(jù)系統(tǒng)功能要求,可以將問題解決分為以下步驟: 1)應(yīng)用系統(tǒng)分析,建立該系統(tǒng)的功能模塊框圖以及界面的組織和設(shè)計; 2)分析系統(tǒng)中的各個實體以及它們之間的關(guān)系; 3)根據(jù)問題描述,設(shè)計系統(tǒng)的類層次; 4)完成類層次中各個類的描述; 5)完成類中各個成員函數(shù)的定義; 6)完成系統(tǒng)的應(yīng)用模塊; 7)功能調(diào)試; 8)完成系統(tǒng)總結(jié)報告。 目錄 1. 系統(tǒng)需求分析. 0 2. 總體設(shè)計 . 0 3. 詳細(xì)設(shè)計及實現(xiàn) . 4 4. 系統(tǒng)調(diào)試 . 4 5. 結(jié)論. 錯誤! 未定義書簽。 6. 心得體會 錯誤! 未定義書簽。 7. 參考書目 . 38 1. 系統(tǒng)需求分析 1.

5、1 系統(tǒng)設(shè)計的目的與意義: 現(xiàn)在的公司越做越大,公司的人員數(shù)量越來越多,因此需要一個公司人員管理系 統(tǒng)來對公司的人員進(jìn)行管理。 1.2 系統(tǒng)功能需求: 本系統(tǒng)有五個類:Stuff 類、Manager類、Salesman 類、SalesManager 類、Technicist 類,存儲基本信息、經(jīng)理信息、銷售人員信息、銷售經(jīng)理信息及技術(shù)人員信息。 1基礎(chǔ)信息的添加功能 程序能夠任意添加經(jīng)理信息、銷售信息、銷售經(jīng)理信息和技術(shù)人員信息。 2修改功能 對已添加的記錄 (經(jīng)理信息、 銷售信息、 銷售經(jīng)理信息和技術(shù)人員信息) 進(jìn)行修改。 3刪除功能 對已添加的記錄 (經(jīng)理信息、 銷售信息、 銷售經(jīng)理信息和

6、技術(shù)人員信息) 進(jìn)行刪除。 如果當(dāng)前系統(tǒng)中沒有相應(yīng)的記錄,則提示“記錄為空! ”并返回操作;否則輸入要 刪除的編號對該記錄進(jìn)行刪除,如果沒有找到,則提示相應(yīng)的記錄不存在。 4查詢功能 可根據(jù)職位的編號查詢某職位的所有職員信息。 可根據(jù)職員的編號查詢某職員的所有信息。 如果未找到,給出相應(yīng)的提示信息,如果找到,則顯示相應(yīng)的記錄信息。 5保存功能 將當(dāng)前系統(tǒng)中各類記錄存入文件中。 6讀取功能 將保存在文件中的信息讀入到當(dāng)前系統(tǒng)中,以供用戶使用。 2. 總體設(shè)計 2.1 系統(tǒng)功能分析: 系統(tǒng)通過調(diào)用函數(shù)來實現(xiàn)信息錄入、信息修改、信息刪除、信息查詢以及數(shù)據(jù)保存 文件等功能。add ()函數(shù)用于錄入信息

7、;modify ()函數(shù)用來修改信息;del ()函數(shù) 用來修改信息;look ()函數(shù)用來搜索職員信息;read ()函數(shù)用于將文件中的數(shù)據(jù)讀 取到內(nèi)存中;save ()函數(shù)用于將內(nèi)存中的信息存入文件內(nèi);count用于統(tǒng)計職員總數(shù); show ()顯示職員信息;主函數(shù) ma in ()用于調(diào)用這些函數(shù)。 2.2系統(tǒng)功能模塊劃分與設(shè)計: 系統(tǒng)定義了 Stuff類、Manager類、Salesman類、SalseManager類這五個類,定義 了 add ()、modify ()、del ()、read ()、save ()、look ()、count()、show()、等 函數(shù)來實現(xiàn)系統(tǒng)所需功

8、能。 2.3系統(tǒng)功能模塊圖: 公司人員信息管理系 經(jīng)理信息管理 銷售人員信息管理 銷售經(jīng)理信息管理 技術(shù)人員信息管理 (1) Stuff 類 (抽象類)的設(shè)計 Stuff virtual void read()=0; virtual void add()=0; virtual void modify(i nt)=0; virtual void del( in t)=0; virtual void save()=0; Virtual void look()=0; Virtual void coun t()=0; Virtual void show()=0; Virtual void In put

9、()=0; Virtual void Output()=0; (2) 經(jīng)理類的設(shè)計 Man ager float pay; void read(); void add(); void look(); void show(); void modify(i nt); void del( in t); void coun t(); void save(); void In put() (3) 銷售人員類的設(shè)計 Salesma n float market; float rate; void read(); void add(); void look(); void show(); void modi

10、fy(i nt); void del( in t); void coun t(); void save(); void In put() (4) 銷售經(jīng)理類的設(shè)計 SalesMa nager float pay1,market1,rate1; void read(); void add(); void look(); void show(); (5) 技術(shù)人員類的設(shè)計 void modify(i nt); void del( in t); void coun t(); void save(); void In put(); Tech nicist float hour; void read()

11、; void add(); void look(); (6)各個類的關(guān)系描述 Man ager float pay; void read(); void add(); void look(); void show(); Void modify(i nt); void del( in t); void coun t(); void save(); void In put(); Salesma n float market; float rate; void read(); void add(); void look(); void show(); void modify(i nt); void

12、del( in t); void coun t(); void save(); SalesMa nager floatpay1,market1,rate1; void read(); void add(); void look(); void show(); void modify(i nt); void del( in t); void coun t(); void save(); void In put(); Stuff virtual void read()=0; virtual void add()=0; virtualvoid modify(i nt)=O; virtual void

13、 del( in t)=0; virtual void save()=0; Virtual void look()=0; Virtual void coun t()=0; Virtual void show()=0; Virtual void In put()=0; Tech ni cist float hour; void read(); void add(); void look(); void show(); void modify(int); void del( in t); void coun t(); void save(); void In put() 3. 詳細(xì)設(shè)計及實現(xiàn) 3.

14、1Stuff 類(抽象類 )的實現(xiàn) class Stuff public: virtual void read()=0; virtual void add()=0; virtual void look()=0; virtual void show()=0; virtual void modify(int)=0; virtual void del(int)=0; virtual void count()=0; virtual void save()=0; virtual void Input()=0; virtual void Output()=0; int number; char name1

15、00; char sex10; char department10; char rank10; float monpay; 3.2 經(jīng)理類的實現(xiàn) #include Stuff.h class Manager:public Stuff public: void read(); void add(); void look(); void show(); void modify(int); void del(int); void count(); void save(); void Input() coutnumber; coutname; coutsex; coutdepartment; cout

16、rank; coutpay; monpay=pay; void Output() coutsetw(10) 經(jīng)理信息 setw(10) 編號 setw(10) 姓名 setw(10) 性別 setw(10) 所在部門 setw(10) 級別 setw(10) 月薪 endl; coutsetw(10) 經(jīng) 理 信 息 setw(10)numbersetw(10)namesetw(10)sexsetw(10)departmentsetw(10)ra nksetw(10)monpaym1count_Manager.numberm1count_Mm1count_Manager.

17、sex m1count_Manager.departmentm1count_Manager.rankm1count_Manager.monpay; while(!managerfile.eof() managerfilem1count_Manager.numberm1count_Mm1count_Manager. sexm1count_Manager.departmentm1count_Manager.rankm1count_Manager.monpay; count_Manager+; managerfile.close(); void Manager:add() m1

18、count_Manager.number=number; strcpy(m1count_M,name); strcpy(m1count_Manager.sex,sex); strcpy(m1count_Manager.department,department); strcpy(m1count_Manager.rank,rank); m1count_Manager.monpay=monpay; m1count_Manager.number=number; count_Manager+; void Manager:look() if(count_Manager=0) cou

19、t 對不起,沒有相關(guān)記錄! endl; return; int choice; cout 請選擇查找方式: 1、編號查找 2 、姓名查找 choice; while(choice!=1 switch(choice) case 1: coutnumber; for(int i=0;icount_Manager;i+) if(m1i.number=number) m1i.Output(); return; cout 沒有相關(guān)人員 !endl; break; case 2: coutname; for(int i=0;icount_Manager;i+) if(strcmp(,nam

20、e)=0) m1i.Output(); return; cout 沒有相關(guān)人員 !endl; break; default:cout 無此選項,請重試! endl;break; void Manager:show() for(int i=0;i=count_Manager-1;i+) m1i.Output(); void Manager:modify(int index) m1index-1.number=number; strcpy(,name); strcpy(m1index-1.sex,sex); strcpy(m1index-1.department,dep

21、artment); strcpy(m1index-1.rank,rank); m1index-1.monpay=monpay; void Manager:del(int index) for(int i=index;i=count_Manager-1;i+) m1i-1.number=m1i.number; strcpy(,); strcpy(m1i-1.sex,m1i.sex); strcpy(m1i-1.department,m1i.department); strcpy(m1i-1.rank,m 1i.rank); m1i-1.monpay=m1i.m

22、onpay; count_Manager-; void Manager:count() int sum=0; int male=0,female=0; for(int i=0;icount_Manager;i+) if(!strcmp(m1i.sex,男 ) male+; if(!strcmp(m1i.sex,女 ) female+; sum+; cout 總的人數(shù)是: sumendl; cout 男的人數(shù)是: maleendl; cout 女的人數(shù)是: femaleendl; void Manager:save() ofstream managerfile; managerfile.open

23、( 經(jīng)理信息管理 .dat); for(int i=0;i=count_Manager-1;i+) m1i.sex managerfilem1i.number m1i.department m1i.rank m1i.monpayendl; managerfile.close(); 3.3 銷售人員類的實現(xiàn) #include Stuff.h class Salesman:public Stuff public: void read(); void add(); void look(); void show(); void modify(int); void del(int);

24、void count(); void save(); void Input() coutnumber; coutname; coutsex; coutdepartment; coutrank; coutmarketrate; monpay=market*rate; void Output() coutsetw(10) 銷 售 人 員 信 息 setw(10) 編 號 setw(10) 姓 名 setw(10) 性別 setw(10) 所在部門 setw(10) 級別 setw(10) 月薪 endl; coutsetw(10) 經(jīng) 理 信 息 setw(10)numbersetw(10)nam

25、esetw(10)sexsetw(10)departmentsetw(10)ra nksetw(10)monpays1count_Salesman.numbers1count_Ss1count_Salesman.s exs1count_Salesman.departments1count_Salesman.ranks1count_Salesman.monpay; while(!Salesmanfile.eof() Salesmanfiles1count_Salesman.numbers1count_Ss1count_Salesman. sexs1

26、count_Salesman.departments1count_Salesman.ranks1count_Salesman.monpay J count_Salesman+; Salesmanfile.close(); void Salesman:add() s1count_Salesman.number=number; strcpy(s1count_S,name); strcpy(s1count_Salesman.sex,sex); strcpy(s1count_Salesman.department,department); strcpy(s1count_Sale

27、sman.rank,rank); s1count_Salesman.monpay=monpay; count_Salesman+; void Salesman:look() if(count_Salesman=0) cout 對不起,沒有相關(guān)記錄! endl; return; int choice; cout 請選擇查找方式: 1、編號查找 2 、姓名查找 choice; while(choice!=1 switch(choice) case 1: coutnumber; for(int i=0;icount_Salesman;i+) if(s1i.number=number) s1i.Out

28、put(); return; cout 沒有相關(guān)人員 !endl; break; case 2: coutname; for(int i=0;icount_Salesman;i+) if(strcmp(,name)=0) s1i.Output(); return; cout 沒有相關(guān)人員 !endl; break; default:cout 無此選項,請重試! endl;break; void Salesman:show() for(int i=0;i=count_Salesman-1;i+) s1i.Output(); void Salesman:modify(int ind

29、ex) s1index-1.number=number; strcpy(,name); strcpy(s1index-1.sex,sex); strcpy(s1index-1.department,department); strcpy(s1index-1.rank,rank); s1index-1.monpay=monpay; void Salesman:del(int index) for(int i=index;i=count_Salesman-1;i+) s1i-1.number=s1i.number; strcpy(,)

30、; strcpy(s1i-1.sex,s1i.sex); strcpy(s1i-1.department,s1i.department); strcpy(s1i-1.rank,s1i.rank); s1i-1.monpay=s1i.monpay; count_Salesman-; void Salesman:count() int sum2=0; int male2=0,female2=0; for(int i=0;icount_Salesman;i+) if(!strcmp(s1i.sex, male2+; 男) if(!strcmp(s1i.sex, female2+; sum2+; 女)

31、 cout 總的人數(shù)是: sum2endl; cout 男的人數(shù)是: male2endl; cout 女的人數(shù)是: female2endl; void Salesman:save() ofstream Salesmanfile; Salesmanfile.open( 銷售人員信息管理 .dat); for(int i=0;i=count_Salesman-1;i+) s1i.sex Salesmanfiles1i.number s1i.department s1i.rank s1i.monpayendl; Salesmanfile.close(); 3.4 銷售經(jīng)理類的實現(xiàn)

32、Salesmanager.h class Salesmanager:public Stuff public: float pay1,market1,rate1; void read(); void add(); void look(); void show(); void modify(int); void del(int); void count(); void save(); void Input() coutnumber; coutname; coutsex; coutdepartment; coutrank; coutpay1 market1 rate1; monpay=market1

33、*rate1+pay1; void Output() coutsetw(10) 銷 售 經(jīng) 理 信 息 setw(10) 編 號 setw(10) 姓 名 setw(10) 性別 setw(10) 所在部門 setw(10) 級別 setw(10) 月薪 endl; coutsetw(10) 經(jīng) 理 信 息 setw(10)numbersetw(10)namesetw(10)sexsetw(10)departmentsetw(10)ra nksetw(10)monpayss1count_Salesmanager.numberss1count_Sss1co unt

34、_Salesmanager.sexss1count_Salesmanager.departmentss1count_Salesmanager.ran kss1count_Salesmanager.monpay; while(!Salesmanagerfile.eof() Salesmanagerfiless1count_Salesmanager.numberss1count_Sss1c ount_Salesmanager.sexss1count_Salesmanager.departmentss1count_Salesmanager.ra nkss1count_

35、Salesmanager.monpay; count_Salesmanager+; Salesmanagerfile.close(); void Salesmanager:add() ss1count_Salesmanager.number=number; strcpy(ss1count_S,name); strcpy(ss1count_Salesmanager.sex,sex); strcpy(ss1count_Salesmanager.department,department); strcpy(ss1count_Salesmanager.rank,rank

36、); ss1count_Salesmanager.monpay=monpay; count_Salesmanager+; void Salesmanager:look() if(count_Salesmanager=0) cout 對不起,沒有相關(guān)記錄! endl; return; int choice; endl; coutchoice; while(choice!=1 case 1: coutnumber; for(int i=0;icount_Salesmanager;i+) if(ss1i.number=number) ss1i.Output(); return; cout 沒有相關(guān)人

37、員 !endl; break; case 2: coutname; for(int i=0;icount_Salesmanager;i+) if(strcmp(,name)=0) ss1i.Output(); return; cout 沒有相關(guān)人員 !endl; break; default:cout 無此選項,請重試! endl;break; void Salesmanager:show() for(int i=0;i=count_Salesmanager-1;i+) ss1i.Output(); void Salesmanager:modify(int index) ss

38、1index-1.number=number; strcpy(,name); strcpy(ss1index-1.sex,sex); strcpy(ss1index-1.department,department); strcpy(ss1index-1.rank,rank); ss1index-1.monpay=monpay; void Salesmanager:del(int index) for(int i=index;i=count_Salesmanager-1;i+) ss1i-1.number=ss1i.number; strcpy(ss1i-1.nam

39、e,); strcpy(ss1i-1.sex,ss1i.sex); strcpy(ss1i-1.department,ss1i.department); strcpy(ss1i-1.rank,ss1i.rank); ss1i-1.monpay=ss1i.monpay; count_Salesmanager-; void Salesmanager:count() int sum2=0; int male2=0,female2=0; for(int i=0;icount_Salesmanager;i+) if(!strcmp(ss1i.sex,男 ) male2+; if(!st

40、rcmp(ss1i.sex,女 ) female2+; sum2+; cout 總的人數(shù)是: sum2endl; cout 男的人數(shù)是: male2endl; cout 女的人數(shù)是: female2endl; void Salesmanager:save() ofstream Salesmanagerfile; Salesmanagerfile.open( 銷售經(jīng)理信息管理 .dat); for(int i=0;i=count_Salesmanager-1;i+) ss1i.sex Salesmanagerfiless1i.number ss1i.department ss

41、1i.rank ss1i.monpayendl; Salesmanagerfile.close(); 3.5 技術(shù)人員類的實現(xiàn) Technicist.h class Technicist:public Stuff public: void read(); void add(); void look(); void show(); void modify(int); void del(int); void count(); void save(); void Input() coutnumber; coutname; coutsex; coutdepartment; coutrank; cout

42、hour; monpay=100*hour; void Output() coutsetw(10) 技 術(shù) 人 員 信 息 setw(10) 編 號 setw(10) 姓 名 setw(10) 性別 setw(10) 所在部門 setw(10) 級別 setw(10) 月薪 endl; coutsetw(10) 技 術(shù) 人 員 信 息 setw(10)numbersetw(10)namesetw(10)sexsetw(10)departmentsetw(10)ra nksetw(10)monpayt1count_Technicist.numbert1count_Tt

43、1count_Techn icist.sext1count_Technicist.departmentt1count_Technicist.rankt1count_Techn icist.monpay; while(!Technicistfile.eof() Technicistfilet1count_Technicist.numbert1count_Tt1count_T echnicist.sext1count_Technicist.departmentt1count_Technicist.rankt1count_T echnicist.monpay; count

44、_Technicist+; Technicistfile.close(); void Technicist:add() t1count_Technicist.number=number; strcpy(t1count_T,name); strcpy(t1count_Technicist.sex,sex); strcpy(t1count_Technicist.department,department); strcpy(t1count_Technicist.rank,rank); t1count_Technicist.monpay=monpay; count_Tech

45、nicist+; void Technicist:look() if(count_Technicist=0) cout 對不起,沒有相關(guān)記錄! endl; return; int choice; cout 請選擇查找方式: 1、編號查找 2 、姓名查找 choice; while(choice!=1 switch(choice) case 1: coutnumber; for(int i=0;icount_Technicist;i+) if(t1i.number=number) t1i.Output(); return; cout 沒有相關(guān)人員 !endl; break; case 2: co

46、utname; for(int i=0;icount_Technicist;i+) if(strcmp(,name)=0) t1i.Output(); return; cout 沒有相關(guān)人員 !endl; break; default:cout 無此選項,請重試! endl;break; void Technicist:show() for(int i=0;i=count_Technicist-1;i+) t1i.Output(); void Technicist:modify(int index) t1index-1.number=number; strcpy(t1index

47、-1.name,name); strcpy(t1index-1.sex,sex); strcpy(t1index-1.department,department); strcpy(t1index-1.rank,rank); t1index-1.monpay=monpay; void Technicist:del(int index) for(int i=index;i=count_Technicist-1;i+) t1i-1.number=t1i.number; strcpy(,); strcpy(t1i-1.sex,t1i.sex); strcpy(t1i

48、-1.department,t1i.department); strcpy(t1i-1.rank,t1i.rank); t1i-1.monpay=t1i.monpay; count_Technicist-; void Technicist:count() int sum1=0; int male1=0,female1=0; for(int i=0;icount_Technicist;i+) if(!strcmp(t1i.sex,男 ) male1+; if(!strcmp(t1i.sex,女 ) female1+; sum1+; cout 總的人數(shù)是: sum1endl; cout 男的人數(shù)是

49、: male1endl; cout 女的人數(shù)是: female1endl; void Technicist:save() ofstream Technicistfile; Technicistfile.open( 技術(shù)人員信息管理 .dat); for(int i=0;i=count_Technicist-1;i+) t1i.sex Technicistfilet1i.number t1i.department t1i.rank t1i.monpayendl; Technicistfile.close(); 3.6 main.cpp #include #include #in

50、clude #include #include #include Stuff.h #include Manager.h #include Technicist.h #include Salesman.h #include Salesmanager.h const int MAXMANAGER=100; const int MAXTECHNICIST=100; const int MAXSALESMAN=100; const int MAXSALESMANager=100; Manager m1MAXMANAGER; Technicist t1MAXTECHNICIST; Salesman s1

51、MAXSALESMAN; Salesmanager ss1MAXSALESMANager; int count_Manager=0; int count_Technicist=0; int count_Salesman=0; int count_Salesmanager=0; Stuff *p=NULL; char out; / 經(jīng)理管理子菜單 void Manager_manage() int choice,i=0; bool quit=false; while(1) system(cls); cout* 經(jīng)理管理子菜單 * *e cout 1. 添加經(jīng)理信息 endl; cout 2. 查

52、詢經(jīng)理信息 endl; cout 3. 顯示經(jīng)理信息 endl; cout 4. 修改經(jīng)理信息 endl; cout 5. 刪除經(jīng)理信息 endl; cout 6. 統(tǒng)計經(jīng)理人數(shù) endl; cout 0. 退出 endl; cout*endl; coutchoice; switch(choice) case 1: Manager m2; p= cout 請輸入要添加的經(jīng)理的信息 n; m2.Input(); for(int i=0;icount_Manager;i+) endl;break; if(m1i.number=m2.number) cout=MAXMANAGER) cout 經(jīng)理庫

53、已滿,無法添加! endl;return; else coutout; if(out=y) p-add(); p-save(); break; case 2: Manager m3; p= p-look(); system(pause); break; case 3: Manager m4; p= p-show(); if(count_Manager=0) cout 系統(tǒng)中無存儲記錄! endl; system(pause); break; case 4: Manager m5; p= if(count_Manager=0) cout 系統(tǒng)中無存儲記錄! show(); coutindex;

54、for(int i=0;icount_Manager;i+) if(m1i.number=index) cout 請對經(jīng)理信息進(jìn)行修改: Input(); coutout; if(out=y) p-modify(index); p-save(); return; else cout 無此經(jīng)理信息! endl; system(pause); break; case 5: Manager m6; p= int index; if(count_Manager=0) cout 經(jīng)理庫為空! endl; else for(int i=0;i=count_Manager-1;i+) m1i.sex cou

55、tm1i.number m1i.department m1i.rank m1i.monpayendl; coutindex; for(int i=0;icount_Manager;i+) if(m1i.number=index) cout 繼續(xù) endl; coutout; if(out=y) p-del(index); p-save(); return; cout 該編號的經(jīng)理信息不存在! count(); system(pause); break; case 0: quit=true; break; default: cout 請輸入 06 之間的數(shù)字! endl; br

56、eak; if(quit=true) break; system(cls); return; / 技術(shù)人員管理子菜單 void Technicist_manage() int choice,i=0; bool quit=false; while(1) cout* 技術(shù)人員信息管理子菜單 *endl; cout 1. 添加技術(shù)人員信息 endl; cout 2. 查詢技術(shù)人員信息 endl; cout 3. 顯示技術(shù)人員信息 endl; cout 4. 修改技術(shù)人員信息 endl; cout 5. 刪除技術(shù)人員信息 endl; cout 6. 統(tǒng)計技術(shù)人員人數(shù) endl; cout 0. 退出

57、endl; system(cls); cout * endl; coutchoice; switch(choice) case 1: Technicist t2; p= cout 請輸入要添加的技術(shù)人員的信息 n; t2.Input(); for(int i=0;icount_Technicist;i+) if(t1i.number=t2.number) cout 該 編 號 的 技 術(shù) 人 員 已 存 在 ! =MAXTECHNICIST) cout 技術(shù)人員庫已滿,無法添加! endl;return; else coutout; if(out=y) p-add(); p-save(); b

58、reak; case 2: Technicist t3; p= p-look(); system(pause); break; case 3: Technicist t4; p= p-show(); if(count_Technicist=0) cout 系統(tǒng)中無存儲記錄! endl; system(pause); break; case 4: Technicist t5; p= if(count_Technicist=0) cout 系統(tǒng)中無存儲記錄! show(); coutindex; for(int i=0;icount_Technicist;i+) if(t1i.number=ind

59、ex) cout 請對技術(shù)人員信息進(jìn)行修改: Input(); coutout; if(out=y) p-modify(index); p-save(); return; cout 無此技術(shù)人員信息! endl; system(pause); break; Technicist t6; case 5: p= int index; if(count_Technicist=0) cout 技術(shù)人員庫為空! endl; else t1i.sex for(int i=0;i=count_Technicist-1;i+) coutt1i.number t1i.department t1

60、i.rank t1i.monpayendl; coutindex; for(int i=0;icount_Technicist;i+) if(t1i.number=index) cout 繼續(xù) endl; coutout; if(out=y) p-del(index); p-save(); return; cout 該編號的技術(shù)人員信息不存在! count(); system(pause); break; case 0: quit=true; break; default: cout 請輸入 06 之間的數(shù)字! endl; break; if(quit=true) break; system(

溫馨提示

  • 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

提交評論