CJCoding With Joseph

Salary With Bonus

Combine constructor chaining, an override, and base. Employee stores baseSalary and has a virtual int Pay() returning baseSalary. Create Manager : Employee with a constructor (int baseSalary, int bonus) that passes baseSalary to the base and stores bonus, and override Pay() to return base.Pay() + bonus. Do NOT write a Main method.

When the tester creates Manager(1000, 200) and prints Pay(), the program prints:
1200

Expected Output:

1200
Topics:
Inheritance
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.