Assignment 3, due Sep 13
Part of
the homework for 22C:60, Fall 2010
|
Always write your name legibly as it appears on your University ID and on the class list! Due in class Monday the 13th because there is no class Friday the 10th.
int squares[]={0,1,4,9,16,25,36,49,64};
Assume that integers are 32-bit values and assume that this table is a constant -- that is, that there will be no assignments to squares or to any of the table entries other than this initializer.
The problem: Write SMAL code equivalent to this. (1 point)
The problem: Write SMAL code to represent a constant list of the first four squares, in ascending order, starting with the square of zero. (1 point)
const char dayname[][]={ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
This is actually a constant array of pointers to null-terminated strings, despite the fact that the declaration looks like a two-dimensional array of characters.
The problem: Write SMAL code to represent this. (1 point)