... BasePlusCommissionEmployee : public CommissionEmployee {
10   public:
11      BasePlusCommissionEmployee(const std::string&, const std::string&,
12         const std::string&, double = 0.0, double = 0.0, double = 0.0);
13
14      void setBaseSalary(double); // set base salary
15      double getBaseSalary() const; // return base salary
16
17   virtual double earnings() const override; // calculate earnings        
18   virtual std::string toString() const override; // string representation
19   private:
20      double baseSalary; // base salary
21   };
22
23   #endif

We modified Fig. 12.1 to create the program of Fig. 12.6. Lines 32–44 of Fig. 12.6 demonstrate again that a CommissionEmployee pointer aimed at a CommissionEmployee object can be used to invoke CommissionEmployee functionality, and a ...

Get C++ How to Program, 10/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.