Question: Please explain how to do part A. show step. Consider the program on the following page, which does compile and execute with no errors, except


Consider the program on the following page, which does compile and execute with no errors, except that it leaks memory (which doesn't matter for this question). (a) Complete the diagram on the next page by adding the remaining objects and all of the additional pointers needed to link variables, objects, virtual function tables, and function bodies. Be sure that the order of pointers in the virtual function tables is clear (i.e., which one first, then next, etc.). One of the objects and a couple of the pointers are already included to help you get started. (b) Write the output produced when this program is executed. If the output doesn't fit in one column in the space provided, write multiple vertical columns showing the output going from top to bottom, then successive columns to the right function code ab aC Bvtbl A:f2 C vibl cout n end ; bbw3(); Sout " " endl; Output: acftQ. retum EXIT SUCCESS j function code ab ac A:12 int manc i A+aa=newA();B+bb=newB()A+ab=bbA+aC=newC()aa>f1(); cout "n endl; bbsf1(); sout n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
