g
public:
SalesManager(char ID,char *Name,int Duty):Person(ID,Name,Duty){} void SetAmount(double s) {
Amount=s; }
void CalcSalary() {
Earning=SalesManagerSalary+Amount*SalesManagerPercent/100; }
void Output() {
CalcSalary();
cout<<No<<"\t"<<Name<<"\t销售经理\t"<<Earning<<endl; } };
公司类的声明
class Company //公司类 { private:
Person *Worker; //员工表 void Clear(); //清除内存中数据 public: Company() {
Worker=0; Load(); }
~Company() {
Person *p; p=Worker; while(p)