小型公司工資管理系統(tǒng)C++課程設(shè)計(jì)報(bào)告(共37頁)_第1頁
小型公司工資管理系統(tǒng)C++課程設(shè)計(jì)報(bào)告(共37頁)_第2頁
小型公司工資管理系統(tǒng)C++課程設(shè)計(jì)報(bào)告(共37頁)_第3頁
小型公司工資管理系統(tǒng)C++課程設(shè)計(jì)報(bào)告(共37頁)_第4頁
小型公司工資管理系統(tǒng)C++課程設(shè)計(jì)報(bào)告(共37頁)_第5頁
已閱讀5頁,還剩32頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上C+程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告課 題: 小型公司工資管理系統(tǒng)專業(yè)班級(jí): xxxxx 學(xué) 號(hào): xxxxxxxx 姓 名: xxxxx 評(píng)閱意見:評(píng)定成績(jī): 指導(dǎo)老師簽名: 2012 年 6 月 12 日指導(dǎo)教師: xxxxx 目錄目錄一、課程設(shè)計(jì)內(nèi)容31.1課程設(shè)計(jì)的目的31. 2設(shè)計(jì)題目及要求3二、設(shè)計(jì)思路4三、程序清單72. 1程序源代碼7四、運(yùn)行結(jié)果304.1程序運(yùn)行313. 2備份文本信息34五、程序使用說明36六、總結(jié)及心得體會(huì)36(要求:給出一級(jí)目錄,宋體加粗,四號(hào)字, 1.5倍行距)一:課程設(shè)計(jì)內(nèi)容1.1、課程設(shè)計(jì)的目的 此次課程設(shè)計(jì)的目的是以程序設(shè)計(jì)語言(C

2、/C+)為基礎(chǔ),針對(duì)具有一定難度的綜合性題目,進(jìn)行分析、編程、調(diào)試和運(yùn)行,進(jìn)一步掌握面向?qū)ο蠛兔嫦蜻^程程序設(shè)計(jì)的基本方法和編程技巧,鞏固所學(xué)理論知識(shí),使理論與實(shí)踐相結(jié)合,提高分析問題、解決問題的能力。通過設(shè)計(jì)一個(gè)簡(jiǎn)單的小型公司工資管理系統(tǒng),進(jìn)一步熟悉C+中類的概念、類的封裝、繼承和多態(tài)的實(shí)現(xiàn)方式。了解系統(tǒng)開發(fā)的需要分析,類層次設(shè)計(jì),模塊分析,編碼測(cè)試,模塊組裝與整體調(diào)試的全過程,逐步熟悉程序設(shè)計(jì)的方法,并養(yǎng)成良好的編程習(xí)慣。1.2、設(shè)計(jì)題目及要求(1) 題目:小型公司工資管理系統(tǒng) 設(shè)計(jì)(2) 設(shè)計(jì)題目及要求:1.公司主要有4類人員:經(jīng)理、技術(shù)員、銷售員、銷售經(jīng)理。要求存儲(chǔ)這些人的職工號(hào)、姓名、

3、月工資、崗位、年齡、性別等信息。其中 (1)職工編號(hào)在輸入人員信息時(shí)生成,每輸入一個(gè)人員信息編號(hào)順序加1。(2)程序?qū)λ腥藛T有提升級(jí)別的功能。   (3)能夠按照不同身份進(jìn)行月薪的計(jì)算。   (4)能按姓名或者編號(hào)查找各類人員的信息。(5)能夠修改/刪除各類人員的信息。(6)能夠顯示所有人員的信息。2.工資的計(jì)算辦法:經(jīng)理:固定月薪為8000;技術(shù)員:工作時(shí)間小時(shí)工資(100元每小時(shí));銷售員:銷售額4%提成;銷售經(jīng)理:底薪(5000)所轄部門銷售額總額0.5%;3)類的層次結(jié)構(gòu)大體如下: 雇員類技術(shù)員類經(jīng)理類銷售員類銷售經(jīng)理類1.3 課程設(shè)

4、計(jì)步驟與方法 1.需求分析:對(duì)用戶提出的問題提出解決的辦法和思路。 2.根據(jù)需求,設(shè)計(jì)系統(tǒng)功能模塊,并設(shè)計(jì)相應(yīng)的類和界面。 3.根據(jù)基本思路,確定輸入和輸出,設(shè)計(jì)程序的算法。 4.確定用到的所有類的描述和定義,并設(shè)計(jì)測(cè)試程序來對(duì)類進(jìn)行測(cè)試。 6.在計(jì)算機(jī)上編譯程序,檢驗(yàn)程序的可運(yùn)行性。1.4 課程設(shè)計(jì)報(bào)告內(nèi)容 寫設(shè)計(jì)報(bào)告(要求正規(guī)打印,A4幅面),內(nèi)容包括:題目系統(tǒng)功能模塊結(jié)構(gòu)圖數(shù)據(jù)結(jié)構(gòu)設(shè)計(jì)及用法說明程序結(jié)構(gòu)(畫流程圖)各模塊的功能試驗(yàn)結(jié)果(包括輸入數(shù)據(jù)和輸出結(jié)果)體會(huì)參考文獻(xiàn)附錄:源程序清單二、設(shè)計(jì)思路1、整體考慮程序應(yīng)該實(shí)現(xiàn)的功能,有員工信息管理、職務(wù)管理、月薪計(jì)算、查找信息、顯示所有人員

5、的信息和退出系統(tǒng)6個(gè)。2、首先定義一個(gè)Employee的雇員基類,然后由此派生出Manager、Seller、Tech三個(gè)分別為經(jīng)理類、銷售員類、技術(shù)員類;再由Seller派生出銷售經(jīng)理類Xmanager。每個(gè)類中的成員都是public型的,所有的繼承都是公有繼承,基類中定義有數(shù)據(jù)輸入和輸出函數(shù)。3、整個(gè)程序由主函數(shù)的一個(gè)for循環(huán)控制,根據(jù)輸入的操作選項(xiàng)通過一個(gè)switch語句判斷該進(jìn)行什么操作,每一個(gè)case后面對(duì)應(yīng)一個(gè)函數(shù),每個(gè)函數(shù)對(duì)應(yīng)一個(gè)操作,1對(duì)應(yīng)信息管理,2對(duì)應(yīng)職務(wù)管理,3對(duì)應(yīng)月薪計(jì)算,4對(duì)應(yīng)查找信息,5對(duì)應(yīng)顯示所有人員的信息,0對(duì)應(yīng)退出系統(tǒng)。4、case中調(diào)用了五個(gè)無參的函數(shù)al

6、lSave()Exit();dataManagement() ;postManaMenu() ;calculateSal() ;findMenu() ;allDisplay() ;五個(gè)函數(shù)均用了模板函數(shù)的實(shí)例化分別進(jìn)行輸入、職務(wù)管理、計(jì)算月薪、顯示全部信息。如輸入中的一個(gè):template <class T , class Ti > void showMember(T & t , Ti * ti )if(t.n <= 0 ) return ; for(t.p = t.head ; t.p != NULL ; t.p = t.p -> next ) t.p -&g

7、t; show() ;showMember()函數(shù)在各個(gè)類中都定義,并且同名,這樣能簡(jiǎn)化程序。5、在進(jìn)行信息輸入時(shí),在基類中定義了一個(gè)虛函數(shù),避免了值的副本,首先給出提示語句,首先選擇要輸入的職工類型,然后依次調(diào)用saveFile(),首先創(chuàng)建類的對(duì)象指針,如Seller * t ;ofstream cout ("S.txt"),建立文件流,創(chuàng)建鏈表,將所輸入的數(shù)據(jù)都保存至文件,并且對(duì)備份文件進(jìn)行命名,同時(shí)確定存儲(chǔ)位置。以便之后的查找和刪除功能的實(shí)現(xiàn)。6、在進(jìn)行工資計(jì)算時(shí),每個(gè)類都定義了各自的calcuSalary()函數(shù),依次計(jì)算出每一種職工的工資,由提示語句選擇是否輸出

8、。7、職務(wù)管理功能的實(shí)現(xiàn),是通過編號(hào)來查找要提升職位的人員,選擇要升為哪一種職位,然后將多余的數(shù)據(jù)成員刪除,在提升后的成員中將工資重新進(jìn)行計(jì)算,予以賦值。8、查找時(shí),建立函數(shù)模板,參數(shù)為class T , class Ti,需要在哪一個(gè)類中查找就將模板實(shí)例化為哪一個(gè)類,每一次查找時(shí),指針都是先指向文件的起始位置,然后用for循環(huán)來控制,先要輸入編號(hào),如t.p != NULL && t.p -> num != no;若當(dāng)前對(duì)象的編號(hào)與輸入的編號(hào)不相等,則指針移向下一個(gè)對(duì)象繼續(xù)查找,若相等則停止查找,并將所找到的信息全部輸出。9、考慮各種數(shù)據(jù)類型還有所需的C+內(nèi)的函數(shù),要引用

9、<iostream><cstring><fstream><iomanip>這四個(gè)頭文件。<fstream>用于數(shù)據(jù)保存至文件。 10、修改和刪除的功能都是按照編號(hào)、利用模板函數(shù)實(shí)例化來實(shí)現(xiàn)的,找到后由switch控制,1.姓名 2.性別 3.年齡 4.編號(hào) 5.工資,先選擇要修改的屬性,然后輸入新信息,將原有信息替換;刪除時(shí),首先在每一個(gè)類中由指針找到要?jiǎng)h除的職工,然后將這個(gè)對(duì)象的每一個(gè)數(shù)據(jù)成員用NULL覆蓋,即清零處理,該職工的信息就被刪除了。11、整體構(gòu)思比較簡(jiǎn)單,基本能夠?qū)崿F(xiàn)各項(xiàng)功能源程序清單:#include<iostr

10、eam>#include<cstring>#include<fstream>#include<iomanip>using namespace std ;class Employeepublic:Employee * next ; char name50; int num; int age; char sex8; double salary;char post30;char * getName()return name ;int getNum()return num ;int getAge()return age ;char * getSex()retu

11、rn sex ;double getSalary()return salary ;char * getPost()return post ;virtual void get()cout<<"t姓名:"cin>>name;cout<<"t性別:"cin>>sex;cout<<"t年齡:"cin>>age;cout<<"t編號(hào):"cin>>num;Employee()salary = 0.0 ;virtual void sh

12、ow()cout<<"t"<<name<<"t"<<sex<<"t"<<age<<"t"<<num<<"t"<<salary<<"t"<<post<<endl ;class Tech:virtual public Employeepublic:int hour ;Tech * next ;void get()Employe

13、e:get(); cout<<"t工作時(shí)間(小時(shí)):" ;cin>>hour ;double gethour()return hour ;double calcuSalary() salary = 100 * hour ;return salary; ;class Seller:virtual public Employeepublic:Seller *next ;double income ;void get()Employee:get();cout<<"t請(qǐng)輸入營(yíng)業(yè)額:"cin>>income ;dou

14、ble calcuSalary()salary = income * 0.04 ;return salary ;double getIncome() return income ; ;class Manager:virtual public Employeepublic:Manager * next ;void calcuSalary()salary = 8000.00 ;class SellerListpublic :int n ;Seller * head , *p ;SellerList()n = 0 ;p = head = NULL ;void inputFile() ;void sa

15、veFile() ; S ;template <class TT , class Ti > void addMember(TT & t , Ti * ti )Ti * p = t.head ;t.head = ti ;if(p = NULL) t.head -> next = NULL ;t.head -> next = p ;t.n + ;void SellerList:inputFile()Seller * t;char na50 ;ifstream cins ("S.txt") ;while(cins >> na )t =

16、new Seller() ;t -> next = NULL ;strcpy(t -> name , na ) ;cins >> (t -> post ) >> (t -> sex) >> (t -> num) >> (t -> age) >> (t -> salary) >> (t -> income) ;addMember(S , t ) ;void SellerList:saveFile() Seller * t ;ofstream cout ("S.txt&

17、quot;) ;for(t = S.head ; t != NULL ; t = t ->next )cout<< (t -> name)<<' ' << (t -> post ) <<' '<< (t -> sex) <<' '<< (t -> num)<<' '<< (t -> age) <<' '<< (t -> salary) <

18、<' '<< (t -> income)<<endl ;class XManager:virtual public Manager,public Sellerpublic :XManager * next , *p ;double calcuSalary() ; ; double XManager:calcuSalary()Seller * t;salary = income * 0.005 ;for(t = S.head ; t != NULL ; t = t -> next ) salary += t -> income *

19、0.005 ;return salary ;class TechListpublic :int n ;Tech * head , * p ;TechList()n = 0 ;p = head = NULL ;void inputFile() ;void saveFile() ; T ;template <class T , class Ti > void showMember(T & t , Ti * ti )if(t.n <= 0 ) return ; for(t.p = t.head ; t.p != NULL ; t.p = t.p -> next ) t

20、.p -> show() ;void TechList:inputFile()char na50 ;Tech * t ;ifstream cint ("T.txt") ;while(cint>> na )t = new Tech() ;t -> next = NULL ;strcpy(t -> name , na ) ;cint >> (t -> post ) >> (t -> sex) >> (t -> num) >> (t -> age) >> (t -&g

21、t; salary) >> (t -> hour) ;addMember(T , t ) ;void TechList:saveFile() Tech * t ;ofstream cout ("T.txt") ;for(t = T.head ; t != NULL ; t = t ->next )cout<< (t -> name)<<' ' << (t -> post ) <<' '<< (t -> sex) <<' &

22、#39;<< (t -> num)<<' '<< (t -> age) <<' '<< (t -> salary) <<' '<< (t -> hour)<<endl ;class XManagerListpublic :int n ;XManager * head , * p ;XManagerList()n = 0 ;p = head = NULL ;void inputFile() ;void saveFile() ; X

23、 ;void XManagerList:inputFile()XManager * t ;char na50 ;ifstream cinx ("X.txt") ;while(cinx >> na )t = new XManager() ;t -> next ;strcpy(t -> name , na ) ;cinx >> (t -> post ) >> (t -> sex) >> (t -> num) >> (t -> age) >> (t -> salary

24、) ;addMember(X , t ) ;void XManagerList:saveFile() XManager * t ;ofstream cout ("X.txt") ;for(t = X.head ; t != NULL ; t = t ->next )cout<< (t -> name)<<' ' << (t -> post ) <<' '<< (t -> sex) <<' '<< (t -> num

25、)<<' '<< (t -> age) <<' '<< (t -> salary)<<endl ;class ManagerListpublic :int n ;Manager * head , *p ;ManagerList()n = 0 ;p = head = NULL ;void inputFile() ;void saveFile() ; M;void ManagerList:inputFile()Manager * t;char na50 ;ifstream cinm ("

26、;M.txt") ;while(cinm >> na )t = new Manager() ;t -> next = NULL ;strcpy(t -> name , na ) ;cinm >> (t -> post ) >> (t -> sex) >> (t -> num) >> (t -> age) >> (t -> salary ) ;addMember(M , t ) ;void ManagerList:saveFile() Manager * t ;ofstre

27、am cout ("M.txt") ;for(t = M.head ; t != NULL ; t = t ->next )cout<< (t -> name)<<' ' << (t -> post ) <<' '<< (t -> sex) <<' '<< (t -> num)<<' '<< (t -> age) <<' '<<

28、(t -> salary)<<endl ;void Exit()cout<<"t您已成功退出系統(tǒng)!"<<endl;exit(0) ;int mainMenu() cout<<"t_"<<endl ;cout<<"t 主菜單"<<endl ;cout<<"t_nn"<<endl ;cout<<"t 1. 員工信息管理"<<endl;cout<<&qu

29、ot;t 2. 職務(wù)管理"<<endl;cout<<"t 3. 月薪計(jì)算"<<endl;cout<<"t 4. 員工信息查找"<<endl;cout<<"t 5. 顯示所有人員信息"<<endl;cout<<"t 0. 退出程序 "<<endl;cout<<"t_nn"<<endl ; cout<<"t請(qǐng)選擇 >> &qu

30、ot; ;return 0;void addDataMenu() int sel ;Tech * ti ;Seller *si ;Manager * mi ;XManager * xi ;cout<<"nnnnt*"<<endl ;cout<<"t 添加員工信息"<<endl ;cout<<"t*n"<<endl ;cout<<"t 1. 技術(shù)員"<<endl;cout<<"t 2. 銷售員&quo

31、t;<<endl;cout<<"t 3. 銷售經(jīng)理"<<endl;cout<<"t 4. 總經(jīng)理"<<endl;cout<<"t 0. 返回"<<endl;cout<<"t_nn"<<endl ; cout<<"t請(qǐng)選擇 : >> " ;while(cin>>sel && (sel > 4 | sel < 0 ) ) cout

32、<<"nt您的輸入有誤,請(qǐng)重新輸入: " ;switch(sel )case 0 : return ;case 1 :ti = new Tech() ;strcpy(ti -> post, "技術(shù)員") ; ti -> get() ;/ti -> show() ;addMember(T , ti) ;break ;case 2 :si = new Seller() ;strcpy(si -> post , "銷售員") ;si -> get() ;addMember(S , si ) ;bre

33、ak ;case 3 :xi = new XManager() ;strcpy(xi -> post , "銷售經(jīng)理") ;xi -> get() ;addMember(X , xi) ;break ;case 4 :mi = new Manager() ;strcpy(mi -> post , "總經(jīng)理") ;mi -> get() ;addMember(M , mi ) ;break ;default : break ;template <class T , class Ti > void renewMember(

34、T & t , Ti * ti )int no , sel ;cout<<"nt請(qǐng)輸入員工編號(hào): " ;cin>>no ;if(findMember(t , ti , no ) = false )cout<<"nt該員工不存在,操作失敗! "<<endl ;return ;cout<<"nnntn"cout<<"t"<<"1.姓名"<<"t"<<"2.

35、性別"<<"t"<<"3.年齡"<<"t"<<"4.編號(hào)"<<"t"<<"5.工資"<<endl ;cout<<"tn"t.p -> show() ;cout<<"ntn"cout<<"nt請(qǐng)輸入要修改的屬性編號(hào):" ;cin>>sel ;if(sel < 1 |

36、sel > 5 )cout<<"nt對(duì)不起,您的輸入有誤,操作失敗 !"<<endl ;return ;char na50 , s8 ;int a , nu ;double sal ;switch(sel )case 1: cout<<"nt請(qǐng)輸入姓名: " ;cin>>na ;strcpy(t.p -> name , na ) ;cout<<"nt修改成功 ! "<<endl ;break ;case 2: cout<<"nt請(qǐng)

37、輸入性別: " ;cin>>s ;strcpy(t.p -> sex , s ) ;cout<<"nt修改成功 ! "<<endl ;break ;case 3: cout<<"nt請(qǐng)輸入年齡: " ;cin>>a ;t.p -> age = a ;cout<<"nt修改成功 ! "<<endl ;break ;case 4: cout<<"nt請(qǐng)輸入編號(hào): " ;cin>>nu ;t.

38、p -> num = nu ;cout<<"nt修改成功 ! "<<endl ;break ;case 5: cout<<"nt請(qǐng)輸入工資: "cin>>sal ;t.p -> salary = sal ;cout<<"nt修改成功 ! "<<endl ;break ;default :break ;void renewData()int sel ;Tech * t ;Seller * s ;XManager * x ;Manager * m ;cou

39、t<<"nnntn"cout<<"t 修改員工信息"<<endl ;cout<<"tn"cout<<"t 1. 技術(shù)員"<<endl;cout<<"t 2. 銷售員"<<endl;cout<<"t 3. 銷售經(jīng)理"<<endl;cout<<"t 4. 總經(jīng)理"<<endl;cout<<"t 0

40、. 返回"<<endl;cout<<"tn" cout<<"t請(qǐng)選擇 : >> " ;while(cin>>sel && (sel > 4 | sel < 0 ) ) cout<<"nt您的輸入有誤,請(qǐng)重新輸入: " ;switch(sel )case 0 : return ;case 1 :renewMember(T , t ) ;break ;case 2 : renewMember(S , s ) ;break ;cas

41、e 3 : renewMember(X , x ) ;break ;case 4 :renewMember(M , m ) ;break ;default : break ;template <class T , class Ti > bool deleteMember(T & t , Ti * ti , int no)if(findMember(t , ti , no ) = false )cout<<"nt該員工不存在,操作失敗! "<<endl ;return false;t.n - ;if(t.head -> num

42、 = no )delete(t.head ) ;t.head = NULL ;return true;Ti * pi ;for(ti = t.head ; ti -> next != NULL && ( (ti -> next -> num) != no) ; ti = ti -> next ) ;pi = ti -> next -> next ;delete(ti -> next ) ;ti -> next = pi ;return true ;void deleteData()int sel ;Tech * t ;Seller

43、 * s ;XManager * x ;Manager * m ;cout<<"nnnt*"<<endl ;cout<<"t_n"<<endl ;cout<<"t 刪除員工信息"<<endl ;cout<<"t*n"<<endl ;cout<<"t 1. 技術(shù)員"<<endl;cout<<"t 2. 銷售員"<<endl;cout&l

44、t;<"t 3. 銷售經(jīng)理"<<endl;cout<<"t 4. 總經(jīng)理"<<endl;cout<<"t 0. 返回"<<endl;cout<<"t_nn"<<endl ; cout<<"t請(qǐng)選擇 : >> " ;while(cin>>sel && (sel > 4 | sel < 0 ) ) cout<<"nt您的輸入有

45、誤,請(qǐng)重新輸入: " ;cout<<endl ;int no ;switch(sel )case 0 : return ;case 1 :cout<<"t請(qǐng)輸入編號(hào) : >> " ;cin>>no ;if(deleteMember(T ,t , no) cout<<"nt刪除成功 !"<<endl ;break ;case 2 : cout<<"t請(qǐng)輸入編號(hào) : >> " ;cin>>no ;if(deleteMemb

46、er(S , s , no)cout<<"nt刪除成功 !"<<endl ;break ;case 3 : cout<<"t請(qǐng)輸入編號(hào) : >> " ;cin>>no ;if(deleteMember(X , x, no) ) cout<<"nt刪除成功 !"<<endl ;break ;case 4 :cout<<"t請(qǐng)輸入編號(hào) : >> " ;cin>>no ;if(deleteMember(

47、M , m , no) ) cout<<"nt刪除成功 !"<<endl ;break ;default : break ;void dataManagement() int sel ;while(1)cout<<"nnnnt*"<<endl ;cout<<"t 員工信息管理"<<endl ;cout<<"t*n"<<endl ;cout<<"t 1. 添加信息"<<endl;

48、cout<<"t 2. 修改信息"<<endl;cout<<"t 3. 刪除信息"<<endl;cout<<"t 0. 返回"<<endl;cout<<"t_nn"<<endl ;cout<<"t請(qǐng)選擇 : -> " ;while(cin>>sel && (sel > 3 | sel < 0 ) ) cout<<"nt您的

49、輸入有誤,請(qǐng)重新輸入: " ;switch(sel )case 0 : return ;case 1 : addDataMenu() ; break ;case 2 : renewData() ; break ;case 3 : deleteData() ; break ;default : break ;template <class T , class Ti > bool findMember(T & t , Ti * ti , int no)for(t.p = t.head ; t.p != NULL && t.p -> num !=

50、no ; t.p = t.p -> next ) ;if(t.p != NULL ) return true ;else return false ;void all_Init()T.head = NULL ;S.head = NULL ;M.head = NULL ;X.head = NULL ;T.inputFile() ;S.inputFile() ;M.inputFile() ;X.inputFile() ;void allSave()T.saveFile() ;S.saveFile() ;M.saveFile() ;X.saveFile() ;template <clas

51、s T , class S > void copyMember(T *t , S *s )strcpy(t -> name , s -> name ) ;strcpy(t -> sex , s -> sex ) ;t -> age = s -> age ;t -> num = s -> num ;template <class TT , class Ti > int changePost(TT t , Ti ti )int no , sel ;Tech * tt ;Seller * ss ;XManager * xx ;Mana

52、ger * mm ;cout<<"nt請(qǐng)輸入員工編號(hào): " ;cin>>no ;if(findMember(t , ti , no ) = false )cout<<"nt該員工不存在,操作失敗! "<<endl ;return no ;cout<<"nnnt*"<<endl ;cout<<"t 調(diào)換為: "<<endl ;cout<<"t*n"<<endl ;cout<

53、<"t 1. 技術(shù)員"<<endl;cout<<"t 2. 銷售員"<<endl;cout<<"t 3. 銷售經(jīng)理"<<endl;cout<<"t 4. 總經(jīng)理"<<endl;cout<<"t 0. 返回"<<endl;cout<<"t_nn"<<endl ; cout<<"t請(qǐng)選擇 : >> "

54、 ;while(cin>>sel && (sel > 4 | sel < 0 ) ) cout<<"nt您的輸入有誤,請(qǐng)重新輸入: " ;cout<<endl ;switch(sel )case 0 : return 0 ;case 1 :tt = new Tech() ;strcpy(tt -> post ,"技術(shù)員") ;tt -> salary = 0.0 ;tt -> hour = 0 ;copyMember(tt, t.p ) ;/tt -> show()

55、;addMember(T , tt ) ;/T.head->show() ;/deleteMember(t, ti , no ) ;break ;case 2 : ss = new Seller() ;strcpy(ss -> post ,"銷售員") ;ss -> salary = 0.0 ;ss -> income = 0.0 ;copyMember(ss, t.p ) ;/ss-> show() ;addMember(S , ss ) ;/T.head->show() ;break ;case 3 : xx = new XManag

56、er() ;strcpy(xx -> post ,"銷售經(jīng)理") ;xx -> salary = 8000 ;xx -> income = 0.0 ;copyMember(xx, t.p ) ;/ss-> show() ;addMember(X , xx ) ;/T.head->show() ;break ;case 4 :mm = new Manager() ;strcpy(mm -> post ,"總經(jīng)理") ;mm -> salary = 8000 ;copyMember(mm, t.p ) ;/ss-&g

57、t; show() ;addMember(M , mm ) ;/T.head->show() ;break ;default : break ;return no ;void postManaMenu()int sel , no ;Tech * t ;Seller * s ;XManager * x ;Manager * m ;cout<<"nnnt*"<<endl ;cout<<"t_n"<<endl ;cout<<"t 員工職位調(diào)換"<<endl ;co

58、ut<<"t_nn"<<endl ;cout<<"t 1. 技術(shù)員"<<endl;cout<<"t 2. 銷售員"<<endl;cout<<"t 3. 銷售經(jīng)理"<<endl;cout<<"t 4. 總經(jīng)理"<<endl;cout<<"t_nn"<<endl ; cout<<"t請(qǐng)選擇要調(diào)換的職位編號(hào) >&

59、gt; " ;while(cin>>sel && (sel > 4 | sel < 0) ) cout<<"nt您的輸入有誤,請(qǐng)重新輸入: " ;cout<<endl ;switch(sel )case 0 : return ;case 1 :t = new Tech() ;no = changePost(T , t ) ;deleteMember(T , t , no ) ;break ;case 2 : s = new Seller() ;no = changePost(S , s ) ;dele

60、teMember(S , s , no ) ;break ;case 3 : x = new XManager() ;no = changePost(X , x ) ;deleteMember(X , x , no ) ;break ;case 4 :m = new Manager() ;no = changePost(M , m ) ;deleteMember(M , m , no ) ;break ;default : break ;cout<<"nt調(diào)換成功 ! "<<endl ;template <class T, class Ti &

61、gt; void caluSal(T & t , Ti * ti )for(t.p = t.head ; t.p != NULL ; t.p = t.p -> next ) t.p -> calcuSalary() ;void allDisplay() ;void calculateSal()Tech * t ;Seller * s ;XManager * x ;Manager * m ;caluSal(M , m) ;caluSal(X , x ) ;caluSal(S , s ) ;caluSal(T , t ) ; cout<<"nt工資計(jì)算成功!&q

溫馨提示

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

評(píng)論

0/150

提交評(píng)論