Question: Write a java program with the following classes: Worker: property yearsOfExperience + abstract method gefYearly Bonus() which returns a double value. Worker should be comparable

Write a java program with the following classes: Worker: property yearsOfExperience + abstract method gefYearly Bonus() which returns a double value. Worker should be comparable based on the value of his/her yearlyBonus value. PartTime Worker (subclass of Worker): properties hoursWorked (double) and ratePerHour (double). The yearly Bonus is calculated using the formula: (hours Worked rate PerHour)/100 * yearsOfExperience FulltimeWorker (subclass of Worker): property Salary. The yearlyBonus value is calculated using the formula: (salary/12) *yearsOfExperience Each one of the three classes above should include an all argument constructor + toString0 method ( assume all setters and getters are already implemented so DO NOT WRITE THEM Driver class: Create an array of Workers and fill it with 3 different Workers (your program should work for any number of Workers) and then print the toString0 value of each of the workers in the array sorted in descending order. (note: you may use the available library sort method to sort the array)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
