Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Define a C + + program to manage the employee information. You will define a bage class Employee and two derived classes: FulltimeFmployee and PartimeEmployee.
Define a C program to manage the employee information. You will define a bage class
Employee and two derived classes: FulltimeFmployee and PartimeEmployee. Create
employee objects, inplement inheritance and polymorphism to display the following
employee information
cis Microsht Visual Studio Debug Conselt
Eniployee
Fulltime Employee
Name: Mary Davis
Title: Faculty
Email: mdOwaketech. edu
Salary:
Employee
Parttio Employee
Name: Tom Fox
Title: Secretary
Email: tforaketech. edu
feekly pay:
Define base class Employee with at least the following members
Data member name, title and email
Member finction
Bmployee constructor with parameters
virtual void displayzinployee
virtual fimction in order to be overridden in the derived clasges
and perform polymorphism in the tester program.
Display employee's name, title and email.
Define derived class FulltimeEmployee inherits from Employee class with at least
the following members
Data membergalary
Member fimction
FulltimeRaployee constructor with parameters
void displayEmployee
owerride base class Employee's display Employee
Display employee's type and salary.
Define derived class PartimeEmployee inherits from Employee class with at least
the following members
Data member hourlyWage, hours
Member fimction
ParttimeFanployee constructor with parameters
double calcGrospaycalculate and retum weekly pay hours
hourlywage
woid displayEmployee
ovenide base class Enployee's display Employee
Display employee's weekly pay.
This is the tester program, please review the code and copy it to your tester program,
you may also define your tester program by yourself
int matn
If create Fulltincenployes obiect
gage.eg;
Fulltimnenployen erpPary Davis", "Faculty",
ndQheketech.edu",
cace. e;
If create Parttincenployes object
a:
Partimefaployen empTon Fox", "Secretary",
tfemaketech.edu", e
If create an array of bast class enployee pointers
Employet omployes ;
assign the address of the two enploye cojects in the array?
both enol and enaz are alsa Erployes objects
employes terp;
employes serp;
for int ;;iharr
cout &c "Enployoe & e endl;
If the same function call will generate difforent results depend on
what srployed object pointed to by tha Erployee painter
employeesixdisplayErplayee;
cout ic endi;
Each class should have a corrensponding h and cpp file. Please include comments explaining your code. Thank you!
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