Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use a switch statement to implement the menu. Do not use else-if. Use the four c

ID: 3542671 • Letter: U

Question

Use a switch statement to implement the menu. Do not use else-if. Use the four classes defined in Employee.h, EmployeeHandler.h, Schedule.h, and ScheduleHandler.h. The functions for each class are described below along with when they are invoked by the menu above. Employee ? Setup: Initializes m_firstName, m_lastName, and m_payPerHour with the parameters passed to it. Sets m_activeEmployee to true (i.e., the employee is a current employee). ? GetName: Returns the first and last names (m_firstName and m_lastName) separated by a blank. ? GetIsActive: Returns the value of m_activeEmployee. ? LayOff: Sets the value of m_activeEmployee to false (i.e., the employee is a current employee). ? Output: Displays a current employee record something like this, Use a switch statement to implement the menu. Do not use else-if. Use the four classes defined in Employee.h, EmployeeHandler.h, Schedule.h, and ScheduleHandler.h. The functions for each class are described below along with when they are invoked by the menu above. Employee ? Setup: Initializes m_firstName, m_lastName, and m_payPerHour with the parameters passed to it. Sets m_activeEmployee to true (i.e., the employee is a current employee). ? GetName: Returns the first and last names (m_firstName and m_lastName) separated by a blank. ? GetIsActive: Returns the value of m_activeEmployee. ? LayOff: Sets the value of m_activeEmployee to false (i.e., the employee is a current employee). ? Output: Displays a current employee record something like this, Use a switch statement to implement the menu. Do not use else-if. Use the four classes defined in Employee.h, EmployeeHandler.h, Schedule.h, and ScheduleHandler.h. The functions for each class are described below along with when they are invoked by the menu above. Employee ? Setup: Initializes m_firstName, m_lastName, and m_payPerHour with the parameters passed to it. Sets m_activeEmployee to true (i.e., the employee is a current employee). ? GetName: Returns the first and last names (m_firstName and m_lastName) separated by a blank. ? GetIsActive: Returns the value of m_activeEmployee. ? LayOff: Sets the value of m_activeEmployee to false (i.e., the employee is a current employee). ? Output: Displays a current employee record something like this,

Explanation / Answer

#include<iostream>
#include<fstream>
#include<iomanip>
using namespace std;

#ifndef _EMPLOYEE
#define _EMPLOYEE
#include <string>
using namespace std;
class Employee
{
public:
void Setup( const string& first, const string& last, float pay )
{
m_firstName = first;
m_lastName = last;
m_payPerHour = pay;
m_activeEmployee = true;
}
string GetName()
{
return m_firstName + " " + m_lastName;
}
bool GetIsActive()
{
return m_activeEmployee;
}
void LayOff()
{
m_activeEmployee = false;
}
void Output()
{
if(!m_activeEmployee)
cout << GetName() << ", PAY :$" << fixed << setprecision(2) << m_payPerHour << " (CURRENT EMPLOYEE)" << endl;
else
cout << GetName() << ", PAY :$" << fixed << setprecision(2) << m_payPerHour << " (FORMER EMPLOYEE)" << endl;
}
private:
string m_firstName;
string m_lastName;
float m_payPerHour;
bool m_activeEmployee;
};
#endif

class EmployeeHandler
{
private:
int m_employeeCount;
Employee *m_lstEmployee;
public:
EmployeeHandler()
{
m_employeeCount = 0;
m_lstEmployee = NULL;
}
int GetEmployeeCount()
{
return m_employeeCount;
}
Employee* GetEmployee()
{
int index = EmployeeSelection();
return (m_lstEmployee+index);
}
void AddEmployee()
{
cout << "NEW EMPLOYEE" << endl;
string firstName;
string lastName;
float payPerHour;
cout << "Enter employee