Answered step by step
Verified Expert Solution
Question
1 Approved Answer
10. Examine the following code snippet? void ask (Question q) q.display ChoiceQuestion inherits from Question and adds data members and overrides the display function to
10. Examine the following code snippet? void ask (Question q) q.display ChoiceQuestion inherits from Question and adds data members and overrides the display function to show more data about multiple-choice questions. What happens if a ChoiceQuestion object is passed to the ask function? a. The function works correctly since ChoiceQuestion inherits from the Question base class. b. The Question display function is called instead of the ChoiceQuestion display function that overrides the base class function. c. The ChoiceQuestion data is sliced away, so the display function cannot access the data it needs. d. he ChoiceQuestion display function that overrides the base class function is called and can access all of the data members of the ChoiceQuestion object
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