Question
10.16 (Accounts Payable System Modification) It's possible to include the functionality of the pay- roll application (Figs. G.16-21) in the accounts payable application without modifying
10.16 (Accounts Payable System Modification) It's possible to include the functionality of the pay-
roll application (Figs. G.16-21) in the accounts payable application without modifying Employee
subclasses SalariedEmployee, HourlyEmployee, CommissionEmployee or BasePlusCommission-
Employee. To do so, you can modify class Employee (Fig. G.16) to implement interface Payable and
declare method getPaymentAmount to invoke method earnings. Method getPaymentAmount would
then be inherited by the subclasses in the Employee hierarchy. When getPaymentAmount is called for
a particular subclass object, it polymorphically invokes the appropriate earnings method for that
subclass. Reimplement Exercise 10.15 using the original Employee hierarchy from the payroll appli-
cation of Figs. G.16-G21 . Modify class Employee as described in this exercise, and do not modify any
of class Employee's subclasses
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