using c++ : Write a class father (name) with default constructor that prints the statement” default father const.” And a constructor with parameter (name) that prints the statement (“my name is “<
using c++ :
Write a class father (name) with default constructor that prints the statement” default father
const.”
And a constructor with parameter (name) that prints the statement (“my name is “<<name)
Write a class son that inherited from the class father with the default constructor that prints
the statement “son def. const” and constructor with parameter that calls the constructor with
parameter of the father class and prints (“the son name is “ <<name)
37
Write a class daughter that inherited from father with the default constructor that prints
(“daughter def. constr.”) and a constructor with parameter that prints (“dauter name is
“<<name)
Write the destructor for each class as follows:
Father destructor prints “father dead” and son prints “son dead” and daughter prints
“daughter dead”
In the main function create different objects in different scopes, pass some objects to external
function, create array of objects, create dynamic memory allocation of object and free them
using delete statement. Follow the sequence of outputs to know how the
constructor/destructor works in inheritance.
Step by step
Solved in 2 steps with 1 images