Sale!

ECE 39595 Homework 2 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (3 votes)

After unzipping the HW2.zip, you’ll notice a subdirectory userid, and under that a directory HW2Code with some Java code. This code will be used in each of the three steps below. Part A. Draw virtual function tables (VFTs) for Base and Derived, and arrows from the VFTs to the code executed. You can do this by hand if desired. These should be in a .pdf or JPEG file named A with the appropriate extension. Part B. Examine the code in HW2Code. In the file HW2.java you will notice that each line has an Sx, where x is an integer, after it. You will need to put what is printed out by these lines for Part B. You could compile and run the program but you won’t learn anything, and Java is incapable of learning, so there really isn’t any value in that other than a few points and perhaps discovering on the test that you really don’t know what is going on. Feel free to run it after putting what you think the output is into B.txt, to check your results. If you go some wrong, figure out why and correct your results. Fill in your answers in B.txt using an editor, by leaving a space after the “:” an putting your answer. Thus, in B.txt, for S0 you would have the line S0: XYZ If multiple lines are printed by a statement, answer like this (this isn’t the correct answer, by the way): 19: Derived::bar Base::f4 If a line gives a compile time error, answer “Err” (without the quote marks). For the rest of the program assume that the error line was not executed. If a line prints nothing, and does not give an error, answer “Ok” (also without the quote marks). Part C. By only chainging the Derived class, make the call to f4() in S15 and S25 of main print “Derived::f4”. Again, by only changing the Derived class, make the call in S20 and S30 print out: Derived::foo2 Derived::f2 How to turn in your homework: Use the same directory structure as exists under the HW2 directory. That is, you should have a userid directory. Inside that directory there should be a file A.pdf (or A.jpg or A.jpeg) file with the answer to A and a file B.txt with the answer to B. Also in of the directory there is C that contains the code for Part C.