โ Back to Inheritance
Question 547
Total Staff Pay
Total Staff Pay
Staffisabstractwith anabstractmethodPay. Create two subclasses:ManagerwhosePayreturns5000, andDeveloperwhosePayreturns4000. The tester puts one of each in aStaff[], adds up everyPay(), and prints the total. Do NOT write aMainmethod. The program prints: 9000
Expected Output:
9000
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.