Question: Write suitable parameterized constructor in child class (Employee) so that following code in main() function should run correctly. #include using namespace std; class Person {

Write suitable parameterized constructor in child class (Employee) so that following code in main() function should run correctly.

#include

using namespace std;

class Person

{

protected:

int id;

string name;

char gender;

public:

Person (int j,string n,char gen)

{

id=j;

name=n;

gender=gen;

}

}; //end of class Person

class Employee: public Person

{

string desgination;

public:

//write required parameterized constructor here

void showEmployeeDetails()

{

cout<<"Employee ID: "<

cout<<"Employee Name: "<

cout<<"Employee Gender: "<

cout<<"Employee Designation: "<

}

}; //end of class Employee

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!