Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

Compare the types of managed care organizations (MCOs).

Answered: 1 week ago