Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am beginner. Please use Java. Thank you :) Question 1: The following figure shows implement an inheritance hierarchy of classes about different types of
I am beginner. Please use Java. Thank you :)
Question 1: The following figure shows implement an inheritance hierarchy of classes about different types of employees and invoice. interface Payable + getPayment Amount: double Employee -firstName: String -lastName: String -socialSecurity Number: String Invoice partNumber: String -part Description: String -quantity: int -priceperitem: double Commission Employee -grossSales: double -commission Ratet double HourlyEmployee wage: double hours: double SalariedEmployee -weekly Salary: double BasePlus CommissionEmployee -baseSalary: double PartTimeEmployee -Salary Percentage : double The code of the following classes is given in the attached sre.rar (From Java 9 for Programmers, by Paul Deitel and Harvey Deitel). . Payable.java is an interface that declares the gatPaymentAmount method. Employee.java is an abstract class that is a subclass of Payable and has three fields. It is abstract because it does not implement get Payment Amount. . . CommissionEmployee.java is a concrete class that is a subclass of Employee and adds two fields. BasePluscommissionEmployee.java is a concrete class that is a subclass of Commission Employee and adds one field. HourlyEmployee.java is a concrete class that is a subclass of Employee and adds two fields. SalariedEmployee.java is a concrete class that is a subclass of Employee and adds one field. Invoice.java is a concrete class that is a subclass of payable and has four fields. The main method in PayrollSystem Test.java uses the Employee class and its subclasses. It creates four objects, one for each subclass of Employee and then prints their payment amount. . In this question, you are going to add a new class called Part TimeEmployee.java that extents from SalariedEmployee.java. The new class has an attribute, salaryPercentage, which gives the percentage of weekly salary paid to part-time employees. The new class should include the necessary constructors, getPaymentAmount and toString methods, setter and getter methods for the attribute salaryPercentage In this question, you are going to add a new class called PartTimeEmployee.java that extents from SalariedEmployee.java. The new class has an attribute, salaryPercentage, which gives the percentage of weekly salary paid to part-time employees. The new class should include the necessary constructors, getPaymentAmount and toString methods, setter and getter methods for the attribute salaryPercentage. Modify PayrollSystemTest.java to include the following two new part time employees with salary percentages 50 and 20 for testing new SalariedEmployee("Bill", "Gates","222-22-2222", 2400.00, 50); new SalariedEmployee("Tim", "Andersen", "888-88-8888", 1200.00, 20) 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