CJCoding With Joseph
15free / daySign inCreate account

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 the output shown in Expected Output.

Expected output

1200

= newline. The output ends with a newline, so print one after the last line.

Hints4 available
Topics
Inheritance
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.