Question: Can someone help me with the problem on [Java How to Program, 10th Edition] Chapter 10 Problem 15E Thanks in advance =================================================== (Account Payable System
Can someone help me with the problem on [Java How to Program, 10th Edition]
Chapter 10 Problem 15E
Thanks in advance
===================================================
(Account Payable System Modification) In this exercise, you modify the accounts payable application of Figs. 10.11-10.15 to include the complete functionality of the payroll application of Figs,10.4-10.9. The application should still process two Invoice objects, but now should process one object of each of the four Employee subclasses. If the object currently being processed is a Base-PlusCommissionEmployee, the application should increase the BasePlusCommissionEmployees base salary by 10%. Finally, the application should output the payment amount for each object. Complete the following steps to create the new application.
10.4

![10th Edition] Chapter 10 Problem 15E Thanks in advance =================================================== (Account Payable](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f66edba0896_26766f66edb34dc7.jpg)
10.5

10.9




a) Modify classes HourlyEmployee (Fig. 10.6) and CommossionEmployee (Fig.10.7 in your textbook) to place them in the Payable hierarchy as subclasses of the version of Employee (Fig, 10.13) that implements Payable. [Hint: Change the name of method earnings to getPaymentAmount in each subclass so that the class satisfies its inherited contract with interface payable.]
10.6



10.7


10.13

![that the class satisfies its inherited contract with interface payable.] 10.6 10.7](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f66ee46628d_27566f66ee3da5b6.jpg)
b) Modify class BasePlusCommissionEmployee (Fig, 10.8) such that it extends the version of class CommissionEmployee created in part (a).
10.8


c) Modify PayableInterfaceTest (Fig,10.15) to polymorphically process two Invoices, one SalariedEmployee, one Hourly Employee, one CommissionEmployee and one Base-PlusCommissionEmployee. First output a String representation of each Payable object. Next, if an object is a BasePlusCommissionEmployee, increase its base salary by 10%. Finally, output the payment amount for each Payable object.
10.15


I I Fig. 10.4: Emp loyee.java 2 I/ Employee abstract superclass. 4 public abstract class Employee private final String firstName; private final String lastName; private final String socialSecurityNumber; i0 // constructor public Employee(String firstName, String lastName, 12 String socialSecurityNumber) this.firstName firstName; this.lastName-lastName; this.socialSecurityNumber socialSecurityNumber; 16 17 18 19 20 21 // return first name public String getFirstName O return firstName; 23 24 25 26 27 28 29 30 31 32 // return 1ast name public String getLastNameC return lastName // return social security number public String getSocialSecurityNumberO I I Fig. 10.4: Emp loyee.java 2 I/ Employee abstract superclass. 4 public abstract class Employee private final String firstName; private final String lastName; private final String socialSecurityNumber; i0 // constructor public Employee(String firstName, String lastName, 12 String socialSecurityNumber) this.firstName firstName; this.lastName-lastName; this.socialSecurityNumber socialSecurityNumber; 16 17 18 19 20 21 // return first name public String getFirstName O return firstName; 23 24 25 26 27 28 29 30 31 32 // return 1ast name public String getLastNameC return lastName // return social security number public String getSocialSecurityNumberO
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
