Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10.16 (Accounts Payable System Modification) In this exercise, we modify the accounts payable application of Figs. 10.11-10.15 to include the complete functionality of the payroll

image text in transcribed
10.16 (Accounts Payable System Modification) In this exercise, we 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-Plus CommissionEmployee, the application should increase the BasePlus CommissionEmployee's 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 Hourly Employee (Fig. 10.6) and Commission Employee (Fig. 10.7) 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 getPayment Amount in each subclass so that the class satisfies its inherited contract with interface Payable.] b) Modify class BasePlusCommission Employee (Fig. 10.8) such that it extends the version of class CommissionEmployee created in part (a). c) Modify PayableInterface Test (Fig. 10.15) to polymorphically process two Invoices, one SalariedEmployee, one HourlyEmployee, one Commission Employee and one BasePlusCommissionEmployee. 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

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

11.2. Outline the process of preparing an operating budget

Answered: 1 week ago