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

POST THE SOURCE CODE IN C++ WITH A SCREEN SHOT Write a program using classes fro

ID: 3816834 • Letter: P

Question

POST THE SOURCE CODE IN C++ WITH A SCREEN SHOT

Write a program using classes from Display 15.2 -15.5. Define class Administrator which derives publicly from class SalariedEmployee. You are allowed to change private: to protected: Additional protected members required are: string title: contains the administrators' title, such as CEO, Director or Vice President string responsibility: A member variable of type string that contains the company area of responsibility, such as Production, accounting, or Personal string supervisor; contains the name of this administrator's immediate supervisor double annual_salary: holds the administrator's annual salary. Additional public members required are: A function to change name of immediate supervisor void change_supervisor(string new_super); A function for reading all of a new administrator's data from the keyboard. Note that the data inherited from class Employee will already be fetched by required base class constructors. void get_admin_data(); function to output administrator's data to the screen void print(); a function to print a check with appropriate notations on the check void print_check()

Explanation / Answer

#include <iostream>
#include<string>
using namespace std;
class salariedemployee
{
public:
string nm,des;
int sal;
salariedemployee(string n,string d,int s)
{
nm=s;
des=d;
sal=s;
}
void show()
{
cout<<"Employee Name "<<nm<<endl;
cout<<"Employee Designation "<<des<<endl;
cout<<"Employee Salary "<<sal<<endl;
}
};
class Administrator: public salariedemployee
{
protected :
string title;
string responsibility;
string supervisor;
double annual_salary;
string n1;
string d1;
int s1;
public:
Administrator(string n,string d,int s) : salariedemployee(n,d,s)
{
n1=n;
d1=d;
s1=s;
}
void change_supervisor(string new_super)
{
supervisor=new_super;
}
void get_admin_data()
{
cout<<"Enter admministrator title ";
cin>>title;
cout<<"Enter administrator responsibility ";
cin>>responsibility;
cout<<"Enter administrator supervisor";
cin>>supervisor;
cout<<"Enter administrator annual salary ";
cin>>annual_salary;
}
void print()
{
cout<<"Administrator Title "<<title<<endl;
cout<<"Administrator Responsibility "<<responsibility<<endl;
cout<<"Administrator supervisior "<<supervisor<<endl;
cout<<"Administrator Annual Salary "<<annual_salary<<endl;
}
void print_check()
{
cout<<"Input is taken from the user "<<endl;
cout<<"Output is shown accordingly "<<endl;
}
};
int main()
{
Administrator obj2("Debanjan","Analyst",35000);
obj2.show();
obj2.get_admin_data();
obj2.print();
obj2.change_supervisor("Suman");
obj2.print();
obj2.print_check();
return 0;
}

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