O'Reilly logo

C++11 for Programmers, Second Edition by Harvey M. Deitel, Abbey Deitel, Paul J. Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required