Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Lab #7 Section 1 – Chapter 13 Write a program class called OrderedHourlyEmployee that extends HourlyEmployee implements Ordered. Note I have provided Employee, HourlyEmployee and Ordered classes for...

1 answer below »
Lab #7
Section 1 – Chapter 13
Write a program class called OrderedHourlyEmployee that extends HourlyEmployee
implements Ordered. Note I have provided Employee, HourlyEmployee and Ordered classes for
you on blackboard.
a. The precedes method is passed an Object and if the object is not null and is an
instanceof OrderedHourlyEmployee, it returns true if getPay() < object passed getPay()
else return false.
. The follow method returns true from calling the precedes method with the object
passed into it after checking if the object is not null and is an instanceof
OrderHourlyEmployee.
c. Write a main method that creates two OrderedHourlyEmployee objects and sets the pay
of the first one to 50 and the pay of the other to 100 and prints “Object one pay is less
than Object 2 pay” after the calling the follows methods and it returns true.
Answered Same Day Nov 22, 2021

Solution

Aditi answered on Nov 24 2021
143 Votes
OrderedHourlyEmployee.java
OrderedHourlyEmployee.java
import java.text.ParseException;
public class OrderedHourlyEmployee extends HourlyEmployee implements Ordered {
    public OrderedHourlyEmployee() throws ParseException {
    }
    @Ove
ide
    public boolean precedes(Object other) {
        if(other != null && other instanceof OrderedHourlyEmployee){
            if(get...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here