Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Continue working with three classes Animal, Cat, Dog in the Lab 2 Activity. This time you will practice implementing polymorphism using virtual functions by: Write
Continue working with three classes Animal, Cat, Dog in the Lab Activity. This time you will practice implementing polymorphism using virtual functions by:
Write a function to handle the polymorphism in representing name, number of legs, speak, and move of three above classes' instances
Then in the main function please call the function written in to demonstrate that name, number of legs, speak, and move were output correctly for each class instance sample output as a below picture. Note: output is the same as in lab however, this time you must implement polymorphism using virtual functions to have this output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started