Question: I need to write a java code for this diagram Write the Java code for the classes indicated in the UML diagram below: Employee -
I need to write a java code for this diagram

Write the Java code for the classes indicated in the UML diagram below: Employee - name: String + Employee(name: String) + getName(): String +toString(): String HourlyEmployee SalariedEmployee monthly Salary: double -hourlyWage: double - hours: int +HourlyEmployee(name: String, hourlyWage: double, hours: int) + getHourlyWage(): double + getHours(): int + toString(): String + get Earnings(): double +SalariedEmployee(name: String, monthly Salary: double) + getMonthlySalary): double +toString(): String +getEarnings(): double The earnings of an hourly employee is the hourly wage *hours worked. While the earnings of a salaried employee is the hourly wage * hours worked + monthly salary. Use best practices to write the implementations of the methods (including the constructors). Then write a driver class that will create an HourlyEmployee called John and a SalariedEmployee called Lisa. Their hourly wage (if any), hours worked (if any), and monthly salary (if any) amount is up to you. Call the toString() of each of the employees you created
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
