The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Program in C#
Modify the payroll application. If the object currently being processed is a BasePlusCommissionEmployee, the application should increase the BasePlusCommissionEmployee’s base salary by 10%.Â
Complete the following steps to create the new application:
a) Modify classes HourlyEmployee and CommissionEmployee (Fig. 12.7) to place them in the IPayable hierarchy as derived classes of the version of Employee that implements IPayable. [Hint: Change the name of method Earnings to GetPaymentAmount in each derived class.]
b) Modify class BasePlusCommissionEmployee such that it extends the version of class CommissionEmployee created in Part a.
c) Modify PayableInterfaceTest to polymorphically process three salariedEmployee, two HourlyEmployee, one CommissionEmployee and two Base- PlusCommissionEmployee.
d) Create a menu that allows a user to select one of the following options to display a string representation of each IPayable objects.
Use the following data to test your program:
IPayable[] payableObjects = new IPayable[ 8 ];
payableObjects[ 0 ] = new SalariedEmployee( "John", "Smith", "111-11-1111", 700M );
payableObjects[1] = new SalariedEmployee("Antonio", "Smith", "555-55-5555", 800M);
payableObjects[2] = new SalariedEmployee("Victor", "Smith", "444-44-4444", 600M);
payableObjects[ 3 ] = new HourlyEmployee( "Karen", "Price", "222-22-2222", 16.75M, 40M );
payableObjects[4] = new HourlyEmployee("Ruben", "Zamora", "666-66-6666", 20.00M, 40M);
payableObjects[ 5 ] = new CommissionEmployee( "Sue", "Jones", "333-33-3333", 10000M, .06M );
payableObjects[ 6 ] = new BasePlusCommissionEmployee( "Bob", "Lewis", "777-77-7777", 5000M, .04M, 300M );
payableObjects[7] = new BasePlusCommissionEmployee("Lee","Duarte", "888-88-888", 5000M, .04M, 300M);
Return the following documents
-----------