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

Give a definition for a class TitledEmployee that is a derived class of the base

ID: 666136 • Letter: G

Question

Give a definition for a class TitledEmployee that is a derived class of the base class SalariedEmployee given in Display 16.4. The class Titled- Employee has one additional member variable of type string called title. It also has two additional member functions: get_title, which takes no arguments and returns a string; and set_title, which is a void function that takes one argument of type string. It also redefines the member func- tion set_name. You do not need to give any implementations, just the class definition. However, do give all needed #include directives and all using namespace directives. Place the class TitledEmployee in the namespace employeessavitch

Explanation / Answer

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

namespace second_space{
   class TitledEmployee:public SalariedEmployee{
   public:
       string title;
       void set_title(string t){
           title = t;
       }
       string get_title(){
           return title;
       }
       void set_name(string n){
           name = n;
       }
   };
}

int main(){
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote