Define a class named Animal that holds private data fields name, color, age and sound. Create public functions that set (give values) and get (retrieve values) the data. Write a main() function that demonstrates the class operates correctly by creating at least one Animal object, and calling all the methods defined for the Animal class.
Write the code for the following problem using either C or C++. If there are 8 cars with its car number {11,10,34,56,68,89,65,78} parked in a parking area, then you are looking for a car number 68 by checking every car sequentially from the beginning.
To write a C++ program to illustrate hybrid inheritance concept using student data base creation as an example.
ALGORITHM:
Step 1:Create a class with some methods and variables.
Step 2:Create a new class that extends this class.
Step 3:Create a new class with some new methods.
Step 4:Create a new class again which inherits from classes defined in step 2 and step 3.
Step 5.Create an object of class defined in step 4 and Create it call methods defined in step 2 and step 3.
WAPs in C++ which creates a multilevel inheritance hierarchy of Person, Employee and Teacher classes by explaining differences between public, private and protected inheritances with public, private and protected data.
Create a base class called Solid. Use this class to store two float type values. Derive two classes called Cylinder and Cone from the base class. Add to the base class, a member function get data to initialize base class data members and another member function display to compute and display the volume of figures.