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 »
pdf


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. b. 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. object="" passed="" getpay()="" else="" return="" false.="" b.="" 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="">
Answered Same DayNov 22, 2021

Answer To: Lab #7 Section 1 – Chapter 13 Write a program class called OrderedHourlyEmployee that extends...

Aditi answered on Nov 24 2021
140 Votes
OrderedHourlyEmployee.java
OrderedHourlyEmployee.java
import java.text.ParseException;
public cla
ss OrderedHourlyEmployee extends HourlyEmployee implements Ordered {
    public OrderedHourlyEmployee() throws ParseException {
    }
    @Override
    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