... weekly salary: 800.00 earned $800.00 commission employee: Sue Jones social security number: 333-33-3333 gross sales: 10000.00; commission rate: 0.06 earned $600.00 base-salaried commission employee: Bob Lewis social security number: 444-44-4444 gross sales: 5000.00; commission rate: 0.04; base salary: 300.00 old base salary: $300.00 new base salary with 10% increase is: $330.00 earned $530.00 deleting object of class SalariedEmployee deleting object of class CommissionEmployee deleting object of class BasePlusCommissionEmployee 

Determining an Object’s Type with dynamic_cast

In this example, as we encounter a BasePlusCommissionEmployee object, we wish to increase its base salary by 10 percent. Since we process the Employees polymorphically, ...

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.