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

USING C++ VISUAL STUDIO COMPILER PLEASE SOLVE ASSIGNMENT FULLY FOR BEST ANSWER S

ID: 663611 • Letter: U

Question

USING C++ VISUAL STUDIO COMPILER PLEASE SOLVE ASSIGNMENT FULLY FOR BEST ANSWER SHOW OUTPUT

Objective:

To gain experience on creating derived classes and inheritance.

Project Description

Take the code we've provided for the Employee class (Employee.h) and the Manager class (Manager.h).

Add methods to the classes named:

that let users change the corresponding fields. Take advantage of the inheritance relationship between Employee and Manager--you only need to add each of those methods to 1 class.

Write a Supervisor class. A supervisor is responsible for employees in a specific department and must:

Have a field to store the department name (as a string).

Have getDept() and setDept() methods to access the department field.

Always be salaried (i.e., pay for a single pay period is fixed, no matter how many hours are worked).

Have a constructor that takes initial values for all fields.

What class should Supervisor inherit from?

CREATE Supervisor.h header file

Your code should compile and run correctly with the test program: Empltest.cpp.

Explanation / Answer

#ifndef _SUPERVISOR_H
#define _SUPERVISOR_H

#include "employee.h"

class Supervisor : public Manager {
   public:
       Supervisor(string name, float salary, string dept);
       string getDept();
       void setDept(string s);
       float pay();
   private:
       string dept;
       float salary;
};

Supervisor::Supervisor(string name, float salary, string dep):Manager(name, salary,true){
   dept = dep;
}

Supervisor::setDept(string s){
   dept = s;
}

Supervisor::getDept(){
   return dept;
}