Question: Design an interface called payable in Java with the following methods: double calculatepay ( ) - This method should calculate and return the amount of

Design an interface called payable in Java with the following methods:
double calculatepay()- This method should calculate and return the amount of pay for an employee.
Now, create two classes HourlyEmployee and salariedemployee that implement the Payable interface.
Implement the calculatepay() method in each class to represent the pay calculation for an hourly employee
and a salaried employee respectively.
For the HourlyEmployee class:
It should have instance variables for hourly wage and hours worked.
Implement the calculatepay() method to calculate the pay as the product of hourly wage and hours
worked.
For the
class:
It should have an instance variable for the annual salary.
Implement the calculatepay() method to calculate the pay as the annual salary divided by the number of
pay periods in a year (e.g.,12 for monthly pay).
In main. Instantiate objects of
and salariedEmployee classes, set their attributes, and print the
amount of pay for each employee using the calculatepay() method.
 Design an interface called payable in Java with the following methods:

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!