g
销售员类的声明
class Sales:public Person //销售员类 { private: double Amount; public:
Sales(char ID,char *Name,int Duty,double Amount):Person(ID,Name,Duty) {
this->Amount=Amount; }
double GetAmount() {
return Amount; }
void SetAmount(double Amount) {
this->Amount=Amount; }
void CalcSalary() {
Earning=SalesPercent/100*Amount; }
void Output() {
CalcSalary();
cout<<No<<"\t"<<Name<<"\t销售员\t"<<Amount<<"\t"<<Earning<<endl; } };
销售经理类的声明
class SalesManager:public Person //销售经理类 { private: double Amount;