Question: e the C++ program below is executed. Answer questions (i) and (ii) about the program's output. (OlI pt.] What is printed when Line V and

e the C++ program below is executed. Answer questions (i) and (ii) about the program's output. (OlI pt.] What is printed when Line V and Line W are executed? Circle the one correct answer: (a) Each of Line V and Line W prints "BaseClass's g" (b) Each of Line V and Line W prints "DerivedClass's g" (c) Line V prints "BaseClass's g", and Line W prints "Derivedclass's g (d) Line V prints "DerivedClass's g",and Line W prints "BaseClass's g" (e) The output is implementation-dependent, as there are two functions named g (ii)[1 pt.] What is printed when Line X and Linc Y are executed? Circle the one correct answer: (a) Each of Line X and Line Y prints "BaseClass's g" (b) Each of Line X and Line Y prints "DerivedClass's g" (c) Line X prints "Baseclass's g", and Line Y prints "DerivedClass's g (d) Line X prints "DerivedClass's g", and Line Y prints "BaseClass's g (e) The output is implementation-dependent, as there are two functions named g Suppose we modif the program by deleting the word "virtual " on Line A and on Line B, and we execute the modified program. Answer questions (ii) and (iv) about the modified program's output. (iii) 1pt. What is printed when Line V and Line are executed? Circle the one correct answer (a) Each of Line V and Line W prints "Baseclass's g" (b) Each of Line V and Line W prints "DerivedClass' s 9 (c) Line V prints "BaseClass's g", and Line W prints "Derivedclass's g". (d) Line V prints "DerivedClass's g", and Line W prints "Baseclass's g". (e) The output is implementation-dependent, as there are two nonvirtual functions named g (iv)II pt.] What is printed when Line X and Line Y are executed? Circle the one correct answer: (a) Each of Line X and Line Y prints "Baseclass's g" (b) Each of Line X and Line Y prints "DerivedClass's g" (c) Line X prints "BaseClass's g", and Line Y prints "DerivedClass's g" (d) Line X prints "DerivedClass's g", and Line Y prints "Baseclass's g". (e) The output is implementation-dependent, as there are two nonvirtual functions named g linclude
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
