Question: 08 - PayCalculator < > PayCalculator -payRate:double +getPay(double hours): double +changeRate(double newRate): void RegularPay (no instance variables) (no methods) HazardPay (no instance variables) +getPay(double

image

08 - PayCalculator < > PayCalculator -payRate:double +getPay(double hours): double +changeRate(double newRate): void RegularPay (no instance variables) (no methods) HazardPay (no instance variables) +getPay(double hours): double Create an abstract class PayCalculator that has an attribute payRate given in dollars per hour. The class should also have a method computePay(hours) that returns the pay for a given amount of time. Derive a class RegularPay from PayCalculator, as described above. It should have a constructor that has a parameter for the pay rate. It should not override any of the methods. Then derive a class HazardPay from PayCalculator that overrides the computePay method. The new method should return the amount returned by the base class method multiplied by 1.5.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the implementation of the described classes in Java java Abstract class PayCalculator public a... View full answer

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 Programming Questions!