Write an interface Payable with one method double pay().
Write two classes implementing it:
HourlyWorker(String name, double hours, double rate)—pay()returnshours * rate, and hours above 40 are paid 1.5 times;SalariedWorker(String name, double monthly)—pay()returnsmonthly.
PayrollApp reads: the hourly worker's name, hours and rate, then the salaried worker's name and monthly salary. It puts both in a Payable[] array, prints each pay with two decimals as name: 1000.00, then the total as Total: 3000.00.