Write a console program that implements these classes. In main, write a “driver
ID: 3620656 • Letter: W
Question
Write a console program that implements these classes. In main, write a “driver program” that fully tests the functionality of each class.Use the Date class from the text. (This is composition.) Because all outsourced employees have an ID value of zero, set this value in the Employee constructor call in the OutsourcedEmployee constructor.
In main, create several employees of each type and initialize each employee’s data after you create it.
Create an array of Employee pointers, and Assign each of the pointers to one of the employee objects. Polymorphically process the Employees in a loop using the array of pointers to calculate total payroll. (This is run-time polymorphism).
class Employee {
private:
int ID;
public:
char name[80];
char address[80];
char phone[80];
Date birthDate;
Date hireDate;
Employee(int id);
int GetID();
virtual double getMonthsPay() = 0;
};
class SalariedEmployee : public Employee {
public:
double salary;
double getMonthsPay();
SalariedEmployee(int id);
};
class HourlyEmployee : public Employee {
public:
double hours;
double hourlyRate;
double getMonthsPay();
HourlyEmployee(int id);
};
/* All outsourced employees have an ID code of zero
and are paid a flat salary rate of $20/month. */
class OutsourcedEmployee : public SalariedEmployee {
public:
double getMonthsPay();
OutsourcedEmployee();
};