資源描述:
《公司管理系統(tǒng)源程序.doc》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、#include#include#include#include//全局數(shù)據(jù),對象doubleManagerSalary=6000;//經(jīng)理固定月薪doubleSalesManagerSalary=4000;//銷售經(jīng)理固定月薪doubleSalesManagerPercent=5;//銷售經(jīng)理提成%doubleSalesPercent=0.5;//銷售人員提成%doubleWagePerHour=50;//技術(shù)人員小時工資in
2、tID;//員工標識classPerson//員工類{protected:intNo;//編號charName[20];//姓名intDuty;//崗位doubleEarning;//收入Person*next;//指向員工類的指針public:Person(charID,char*Name,intDuty){this->Duty=Duty;strcpy(this->Name,Name);this->No=ID;}virtualvoidCalcSalary()=0;//計算員工工資的方法virtualvoidO
3、utput()=0;//輸出員工信息函數(shù)friendclassCompany;//定義公司類為友元類};classManager:publicPerson//經(jīng)理類{public:Manager(charID,char*Name,intDuty):Person(ID,Name,Duty){}voidCalcSalary(){Earning=ManagerSalary;}voidOutput(){CalcSalary();cout<4、}};classSalesManager:publicPerson//銷售經(jīng)理類{private:doubleAmounts;public:SalesManager(charID,char*Name,intDuty,doubleAmounts):Person(ID,Name,Duty){this->Amounts=Amounts;}doubleGetAmounts(){returnAmounts;}voidSetAmounts(doubles){Amounts=s;}voidCalcSalary(){Earni
5、ng=SalesManagerSalary+Amounts*SalesManagerPercent/100;}voidOutput(){CalcSalary();cout<6、is->t=T;}doubleGetT(){returnt;}voidSetT(doubleT){this->t=T;}voidCalcSalary(){Earning=WagePerHour*t;}voidOutput(){CalcSalary();cout<7、ar*Name,intDuty,doubleAmount):Person(ID,Name,Duty){this->Amount=Amount;}doubleGetAmount(){returnAmount;}voidSetAmount(doubleAmount){this->Amount=Amount;}voidCalcSalary(){Earning=SalesPercent/100*Amount;}voidOutput(){CalcSalary();cout<8、t"<next;deleteWorke