Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The classes below describe an abstract class named EmployeePerson and two derived concrete classes, EmployeeManager and EmployeeStaff, both of which extend the EmployeePerson class. The

image text in transcribedThe classes below describe an abstract class named EmployeePerson and two derived concrete classes, EmployeeManager and EmployeeStaff, both of which extend the EmployeePerson class. The main program creates objects of type EmployeeManager and EmployeeStaff and prints them. Run the program. The program prints manager and staff data using the EmployeeManager's and EmployeeStaff's printInfo methods. Those classes override EmployeePerson's getAnnualBonus() method but simply return 0. Modify the EmployeeManager and EmployeeStaff getAnnualBonus methods to return the correct bonus rather than just returning 0. A manager's bonus is 10% of the annual salary and a staff's bonus is 7.5% of the annual salary.

zyDE 1.6.1: Employees example: Abstract class and interface The classes below describe an abstract class named EmployeePerson and two derived concrete classes, EmployeeManager and EmployeeStaff, both of which extend the EmployeePerson class. The main program creates objects of type EmployeeManager and EmployeeStaff and prints them. 1. Run the program. The program prints manager and staff data using the EmployeeManager's and EmployeeStaffs printlnfo methods. Those classes override EmployeePerson's getAnnualBonus0 method but simply return 0 2. Modify the EmployeeManager and EmployeeStaff getAnnualBonus methods to return the correct bonus rather than just returning 0. A manager's bonus is 10% of the annual salary and a staff's bonus is 7.5% of the annual salary. Current file: EmployeeMain.java Load default template... 3 public static void main(String [] args) /I Create the objects EmployeeManager managernew EmployeeManager (25); EmployeeStaff stafflnew EmployeeStaff("Michele") 9 10 /Load data into the objects using the Person class's method manager.setData("Michele", "Sales", "03-03-1975", 70000); staffl.setData ("Bob", "Sales", "02-02-1980", 50000); 12 13 // Print the objects manager.printInfo); System.out.println("Annual bonus: " manager.getAnnualBonus) staff1.printInfo); System.out.println("Annual bonus: "+ staff1.getAnnualBonus)) 15 17 20 Pre-enter any input for program, then press run

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions