Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed

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

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

Murach's SQL Server 2012 For Developers

Authors: Bryan Syverson, Joel Murach, Mike Murach

1st Edition

1890774693, 9781890774691

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago