Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN C++ HW_2B - Animal Bird Mammal (Bird and Mammal classes derive from Animal class) 7 files: Animal.h - Bird.h - Mammal.h - Source.cpp Animal.cpp

IN C++

HW_2B - Animal Bird Mammal (Bird and Mammal classes derive from Animal class)

7 files: Animal.h - Bird.h - Mammal.h - Source.cpp Animal.cpp - Bird.cpp - Mammal.cpp 1.) Write a program that produces the following output:

// ==== OUTPUT: ==== Birds are vertebrates in the Aves class. This pelican has gray feathers and weighs 8.5 pounds.

Mammals are vertebrates in the Mammalia class. This black and white dairy cow weighs 500 pounds.

Press any key to continue . . . */ ___________________________________________________________________________________________________

2.) Use the following UML class diagram to specify the 3 classes.

Note: Both Animal and Bird classes have a showAnimal method. Which method gets called depends on the calling object.

In main() . . . 1.) Declare a Bird object named: bird - Pass these values to the constructor: The feathers are gray and weight is 8.5.

2.) Declare a Mammal object named: cow - Pass these values to the constructor: Hair color is black and white and weight is 8.5.

3.) Each object should call its showAnimal function.

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

Simplify: 4xy6 2x5y2

Answered: 1 week ago