Multiple Inheritance Basics
mediumQuestion 445A class can inherit from more than one base class at the same time, gaining the members of all of them.
Flyer (already written) has string fly() const returning "flying".
Swimmer (already written) has string swim() const returning "swimming".
Create a class Duck that inherits publicly from BOTH Flyer and Swimmer.
The runner calls fly() and swim() on a Duck and prints the output shown in Expected Output.
Do NOT write a main function.
Expected output
flying swimming= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Inheritance
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.