11.3.2. Creating a BasePlusCommissionEmployee Class Without Using Inheritance

We now discuss the second part of our introduction to inheritance by creating and testing (a completely new and independent) class BasePlusCommissionEmployee (Figs. 11.711.8), which contains a first name, last name, social security number, gross sales amount, commission rate and base salary.

 1   // Fig. 11.7: BasePlusCommissionEmployee.h 2   // BasePlusCommissionEmployee class definition represents an employee 3   // that receives a base salary in addition to commission. 4   #ifndef BASEPLUS_H  5   #define BASEPLUS_H  6  7   #include <string> // C++ standard string class 8  9   class BasePlusCommissionEmployee10   {11   public:12      BasePlusCommissionEmployee( ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.