Challenge 2: Implement an Animal Class
In this challenge, we'll implement a base class Animal and two derived classes Sheep and Dog.
We'll cover the following...
Problem Statement
The code below has:
-
A parent class named
Animal.- Inside it define:
NameSoundvoid Animal_Details()function:- It prints the name and sound of the
Animal.
- It prints the name and sound of the
- Inside it define:
-
Then there are two derived classes
Dogclass- has a private member
family - has a function named
Dog_detail()which prints detail of the dog
- has a private member
Ask