Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with the below question. Java program (Account Payable System Modification) In this exercise, you modify the accounts payable application of Figs. 10.11-10.15 to

Need help with the below question. Java program

(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 wo 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.

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.]

b.) Modify class BasePlusCommissionEmployee (Fig, 10.8) such that it extends the version of class CommissionEmployee created in part (a).

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.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Fig. 14 Employee abstract superclass I I Fig. 10.4: Emp loyee.java 2 / Employee abstract superclass 4 public abstract class Employee private final String firstName; private final String las private final String socialSecurityNumber; tName; 10 // 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 // return 1ast name public String getLastNameC return lastName 29 30 31 32 // return social security number public String getSocialSecurityNumberO 34 return socialSecurityNumber; 35 37 / return String representation of Employee object 39 0verride public String toStringo return String, format("%s %s%nsocial security number: %s", getFirstNameC), getLas tName O, gtocialSecurityNumber O) 45/ abstract me thod must be overridden by concrete subclasses public abstract double earnings O // no implementation here 47 I/ end abstract class Emp loyee

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Power Of Numbers In Health Care A Students Journey In Data Analysis

Authors: Kaiden

1st Edition

8119747887, 978-8119747887

More Books

Students also viewed these Databases questions

Question

Understand how market research prepares you for success.

Answered: 1 week ago

Question

What is a "rights - based" approach according to Beckstead and Ord?

Answered: 1 week ago

Question

What is the orientation toward time?

Answered: 1 week ago

Question

4. How is culture a contested site?

Answered: 1 week ago