Question: Practicing more with Inheritance, Nested classes, and Operator overloading Objective: The purpose of this lab exercise is to improve your understanding about inheritance, nested classes,

 Practicing more with Inheritance, Nested classes, and Operator overloading Objective: The

Practicing more with Inheritance, Nested classes, and Operator overloading Objective: The purpose of this lab exercise is to improve your understanding about inheritance, nested classes, and operator overloading in C++. Animals are classified into mammals, birds and fish, bats are birds and mammals. For animals in general we need to keep their weight, age, name, and the distance they can travel. For the distance we keep its length and number of hours needed for that to be completed. For mammals, we need number of times they give birth per year. For birds we need to keep number of eggs they lay down per month, and for fish, we need length, width and thickness Define a static variable to keep number of objects in each class. Define these classes and for each class overload the input, output, comparison operator >= which compares two objects in each class. For animals X>=Y if weight of X >= Weight of Y, for birds, X>=Y if number of eggs by X >= those by Y, for fish X>=Y if thickness of X is >= that of Y, for mammals X>=Y if number of times C gives birth is >= that of Y. Write a main program to demonstrate all the functions defined above for the classes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!