Question: PRG - 3 . Assume we have he following classes in a polymorphic relationship. The Employee class is an abstract class. An employee has a
PRG Assume we have he following classes in a polymorphic relationship.
The Employee class is an abstract class. An employee has a first name, an
initial, and a last name. A salary employee receives a fixed salary per month.
An hourly employee receives wages based on the number of hours worked
per month and a fixed ratehour Write the interface files, the implementation
files for all three classes and then test them in an application file.
The sample int main is stated as follows
int main
Instantiation of Employee
SalaryEmployee employeeJohnA "Pape", ;
employeeprint;
Instantiation of Employee
HourlyEmployee employeeLucieC "Bush" ;
employeeprint ;
return ;
Run:
Salary Employee:
John A Pape
Salary :
Payment:
Hourly Employee:
Lucie C Bush
Hours worked:
Rate:
Payment:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
