Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write the java code for the classes indicated in the UML diagram below 1 + VIE Employee -name: String +Employee(name: String) +getName 1 String +toString():
write the java code for the classes indicated in the UML diagram below
1 + VIE Employee -name: String +Employee(name: String) +getName 1 String +toString(): String HourlyEmployee Salaried Employee - monthly Salary: double -hourlyWage: double -hours: int +HourlyEmployee name: Sring, hourlyWage: double, hours: Ink) get Hourly Wagot double + get Hours(): in +toString: String +getEarnings: double +SalariedEmployee(name: String, monthly Salary: double) +ge Monthly Salary: double +toString(): String +getEarning(): double The earnings of an hourly employee is the hourly wage hours worked while the earnings of a salaried employee is the 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started