Homework 3 Due 2/23/98 in class Note: Questions or discussion should be directed to the class newsgroup. (1) Some questions about type checking: (a) What does it mean to do static type checking? (b) What information necessary to do it and where does this information come from? (c) Give three different possible rules for determining when two records have the same type, using structural equivalence as the basic approach. (2) (a) Why are variant records or type unions a required feature in a strongly typed language? (b) What are two problems relating to type safety with the version of this feature that appears in Pascal? (3) (a) What are the necessary elements of a feature that supports the definition of abstract data types? (b) What is the essential difference between the approach taken to defining abstract data types in Ada and Modula-2 from that found in Clu and C++? (4) There are a number of features in C that allow expressions to have side effects. Describe in detail what happens during the execution of the following statement, particularly noting what assignments take place. a = b + ( c = d / b++ ) - 1 How do you rate the readability of this statement? (5) (a) Write a while loop template that is the equivalent of the C for statement template: for ( ; ; ) (b) Evaluate the relative readability and usability characteristics of the C and Pascal for statements.