Question: Please help me to use a cttprogram and create a coding for 5 class of The requirements of the above classes that is needed are

Please help me to use a cttprogram and create a coding for 5 class of The requirements of the above classes that is needed are 1. All of them must have anane and an age even though it is not necessary to declare them in every 2. Hide the name andvaga members but I must be able to access it by creating a getter and setter 3. They can all speak: the Dog barks and the Cat meows. (ie., write a function called speak) classes functions However, the StxaxDacs speak function overrides the speak function of Dog, and it should say woofwoof, The BatDRg, performs an actiep. fetch a stick", while the Swawang performs another astiar; "chase cars" (i.e., write a function called action,) 4. Please help me to construct the family tree above by using inheritance You may add more class members (including variables, functions, constructors, destructors) as necessary such as hixthdax The animal's age increases and "Happy Birthday!" intzaduce: "Hello my name is and I am years old!" Note thespeak and action functions merely display some words on the console Demonstrate encapsulation by writing appropriate functions and data members for the above classes with appropriate access restrictions In your maino) program, a) It is needed to declare an array of seven Animal; b) creating at least one object from each of the five classes; c) assigning the objects in b as elements of the Animal array d) using a suitable loop, call the speak function of all Animal elements (but what happens?) e) Using polymorphism, what can you do differently so that the speak task in question d above yields the correct result corresponding to the actual Animal objects? It is not compulsory for you to write codes to accomplish this especially if it means you have to change many lines of codes Only comments placed at the top of the source file is needed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
