Question: 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
Get step-by-step solutions from verified subject matter experts
