Answered step by step
Verified Expert Solution
Question
1 Approved Answer
6. Create an interface called Characteristic that has two methods likes(), says(). Create a class called Pet that implements the above interface, and has two
6. Create an interface called Characteristic that has two methods likes(), says(). Create a class called Pet that implements the above interface, and has two private data members name and food of string type. Do not define the interface methods in Pet. Write a 2- argument constructor to assign values to its data members. Write 2 member functions to return the name, and food values respectively. Derive a class called Dog from the Pet class that includes a data member favorite_activity. Write a 3-argument constructor to initialize values. Implement the likes() function to display the message in the following format:
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