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(){
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.