To test our
Employee hierarchy, the program in Fig. 13.23 creates an object of each of the four concrete classes
SalariedEmployee, HourlyEmployee, CommissionEmployee and
BasePlusCommissionEmployee. The program manipulates these objects, first with static binding, then polymorphically, using a vector of
Employee pointers. Lines 31–38 create objects of each of the four concrete
Employee derived classes. Lines 43–51 output each
Employee’s information and earnings. Each member-function invocation in lines 43–51 is an example of static binding—at compile time, because we are using name handles (not pointers or references that could be set at execution time), the compiler can identify each object’s ...