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-3. 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 rate/hour. 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 Employee1
SalaryEmployee employee1("John",'A', "Pape", 2500);
employee1.print();
// Instantiation of Employee2
HourlyEmployee employee2("Lucie",'C', "Bush" ,70,20.0);
employee2.print ();
return 0 ;
}
Run:
Salary Employee:
John A. Pape
Salary : 2500
Payment: 2500
Hourly Employee:
Lucie C. Bush
Hours worked: 70
Rate: 20
Payment: 1400
 PRG-3. Assume we have he following classes in a polymorphic relationship.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!