You are provided here with the header files for classes Pare
Solution
parent:
Parent :: Parent(double x)
{
cout<<\"parent id like\"<<x;
}
double Parent :: getX()
{
double i;
cin>>i;
return i;
}
child:
Child :: Child(double x,int a,char c)
{
cout<<\"parent id\"<<x<<\"child id\"<<a<<\"child character\"<<c;
}
int Child::getA()
{
int i;
cin>>i;
return i;
}
char Child::getC()
{
char i;
cin>>i;
return i;
}
a)
constructor is a kind of member function that initializes an instance of its class.
child constructor is a constructor. it is parameter constructor(not default constructor) why because
it have function parameters like x,a,c by different data types.
b)
child.h:
//output operator declaration
friend std::ostream& operator<< (std::ostream &out, const Point &point);
child.cpp:
//implementation
std::ostream& operator<< (std::ostream &out, const Point &point)
{
out <<\"parent id\"<<Child.x<<\"child id\"<<Child.a<<\"child character\"<<Child.c;
return out;
}
definition:
normal or default output operator is used to display built in data types.
overloaded output operator is used to display the user defined data types like objects

