11.3.5. CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy Using private Data

We now reexamine our hierarchy once more, this time using the best software engineering practices. Class CommissionEmployee now declares data members firstName, lastName, socialSecurityNumber, grossSales and commissionRate as private as shown previously in lines 31–36 of Fig. 11.4.

 1   // Fig. 11.14: CommissionEmployee.cpp 2   // Class CommissionEmployee member-function definitions. 3   #include <iostream> 4   #include <stdexcept> 5   #include "CommissionEmployee.h" // CommissionEmployee class definition 6   using namespace std; 7  8   // constructor 9   CommissionEmployee::CommissionEmployee(10      const string &first, ...

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.