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
Get step-by-step solutions from verified subject matter experts
