Assignment 10, due Nov 2
Part of
the homework for 22C:60, Fall 2007
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!
a) Write a header file, gasket.h, to support calls to GASKET. (1/2 point)
b) Write a main program that calls GASKET to print a gasket of height 8 with its lower left corner at line 10 column 22 in the display area -- obviously, this program won't work very well unless the display is at least 10 lines high by 38 characters wide. Your main program should, of course, use your header file to aid it in its call. (1/2 point)
a) Given that R3 and R4 contain pointers to objects, write code to transfer control to ELSE if the objects are in different classes, while falling through if they are in the same subclass. (2/5 point)
b) The class descriptor is a record. Does it have any variable fields, or is the are all of its fields constants? (1/5 point)
c) Based on your answer above, where should the class descriptor be defined, the class.a file, the class.h file? (2/5 point)