Question: Ex2. Virtual holidays! Consider the following C++ program, which does compile and execute successfully. (80 points) On the next page, complete the diagram showing all

 Ex2. Virtual holidays! Consider the following C++ program, which does compileand execute successfully. (80 points) On the next page, complete the diagram

Ex2. Virtual holidays! Consider the following C++ program, which does compile and execute successfully. (80 points) On the next page, complete the diagram showing all of the variables, objects, virtual method tables (vtables) and functions in this program. Parts of the diagram are supplied for you. (60 points) What does this program print when it executes? (60 points) Modify the above program by removing and/or adding the virtual keyword in appropriate place(s) so that the modified program prints HappyHolidays! (including the ! at the end). Draw a line through the virtual keyword where it should be deleted and write in virtual where it needs to be added. Do not make any other changes to the program. Any correct solution will receive full credit. (cont.) Draw your answer to part (a) here. Complete the vtable diagram below. Draw arrows to show pointers from variables to objects, from objects to vtables, and from vtable slots to functions. Note that there may be more slots provided in the blank vtables than you actually need. Leave any unused slots blank

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!