Answered step by step
Verified Expert Solution
Link Copied!

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 1
Fulltime Employee
Name: Mary Davis
Title: Faculty
Email: mdOwaketech. edu
Salary: 60000.00
Employee 2
Parttio Employee
Name: Tom Fox
Title: Secretary
Email: tforaketech. edu
feekly pay: 600.00
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 member-galary
Member fimction
FulltimeRaployee(__)- constructor with parameters
void displayEmployee ()-
owerride base class Employee's display Employee0.
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 calcGrospay0-calculate and retum weekly pay = hours *
hourlywage
woid displayEmployee()-
ovenide base class Enployee's display Employee 0.
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(
1
If create Fulltincenployes obiect
gage.eg);
Fulltimnenployen erp1("Pary Davis", "Faculty", "
ndQheketech.edu",
cace. e9);
If create Parttincenployes object
3a):
Partimefaployen emp2("Ton Fox", "Secretary", "
tfemaketech.edu", 29.e,
If create an array of bast class enployee pointers
Employet omployes [2];
//. assign the address of the two enploye cojects in the array?
7? both enol and enaz are alsa Erployes objects
employes []- terp1;
employes [1]=- serp2;
for (int 1=8;12;iharr )
1
cout &c "Enployoe " & 1+1e endl;
If the same function call will generate difforent results depend on
// what srployed object pointed to by tha Erployee painter
employees[i]-xdisplayErplayee();
}
cout ic endi;
}
Each class should have a corrensponding .h and .cpp file. Please include comments explaining your code. Thank you!
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago