Question: java program - payRate: double (KWD per hour) - name: String The class should also have: - a constructor that initializes the name and payRate.

java program
java program - payRate: double (KWD per hour) - name: String The

- payRate: double (KWD per hour) - name: String The class should also have: - a constructor that initializes the name and payRate. - a method computePay(hours) that returns the pay for a given amount of time (payrate*hour). Derive a class HazardPay from RegularPay. It has the following extra attribute: - hazardRate: double It should: - have a constructor that initializes the name, payRate, and hazardRate - overrides the computePay method. The new method should return the amount returned by the superclass method multiplied by the hazardRate. Create a testing class that includes the main method. It should create: - an object of type RegularPay, and initialize it to ("Nasir", 15) - an object of type HazardPay, initialize it to ("Dalal", 15, 2) Then for both objects, it should call the method computePay, pass to it 40 , and print the outpu as shown below

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!