Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ please! Question 2 This is an exercise to get practice creating classes and using inheritance. No test plan is necessary . Each class must

c++ please!

Question 2

This is an exercise to get practice creating classes and using inheritance.

No test plan is necessary.

Each class must have its own .cpp and .h files.

Create Classes to implement the UML diagram below. (included at bottom of post)

All classes must have default constructors and a secondconstructor that sets all of its attributes.

When any Pet is constructed, it should output:

Im , my color is and Im happy to be your pet!

When the Dog class is asked to bark, it will output:

, the says: Bow Wow! Bow Wow!

When the Bird is asked to fly, it will output:

Yahoo! is flying feet with my wingspan of feet!

When the destructor for a pet is called, it should output:

is leaving now, sorry you didnt like my color of: . :-(

Each output should be on its own line.

Write a program to use pointers, allocation, and new to perform the following.

Create a dog named Lassie with breed of Collie color of Brown
Create a dog name Ruby, with a breed of Mixed with a color of silver
Change Rubys breed to Labrador
Change Rubys color to Chocolate
Create a bird named Tweety, with .6 ft wingspan and color Yellow
Create a bird named Donald Duck, with a 0 wingspan and color white
Change wingspan of Donald Duck to 1.5 feet.
Have Lassie bark
Have Ruby bark
Free Ruby and Lassie .
Have Tweety fly 250 ft.
Have Donald Duck fly 18 ft.
Free Donald Duck.
Cout
Return 0 from main.
End the program without freeing Tweety
Explain the final output, if any, regarding Tweety
image text in transcribed

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

Databases Theory And Applications 27th Australasian Database Conference Adc 20 Sydney Nsw September 28 29 20 Proceedings Lncs 9877

Authors: Muhammad Aamir Cheema ,Wenjie Zhang ,Lijun Chang

1st Edition

3319469215, 978-3319469218

Students also viewed these Databases questions

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

What is meant by organisational theory ?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

5. Understand how cultural values influence conflict behavior.

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago