Assignment 1, due Jan. 20
Part of
the homework for 22C:112, Spring 2011
|
On every assignment, write your name legibly as it appears on your University ID and on the class list! Assignments are due at the start of class on the day indicated (usually Friday). Exceptions 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, either in class or in the teaching assistant's mailbox. Never push late work under someone's door!
a) A subroutine.
b) An integer local variable.
c) A string constant.
d) A global variable.
e) The method table shared by all members of a class in an object-oriented language.
a) Reference to a statically allocated global variable.
b) Reference to another instruction in the current subroutine (for example, as used in a conditional branch instruction).
c) Reference to a local variable.
d) Reference to a field of the record representing an object.
e) Reference to a separately compiled subroutine resolved by the linker.
a) Why is transparency dangerous. (0.5 points)
b) Why is transparency useful. (0.5 points)
Write your own version of the Hello World program in C. Instead of having your program output "hello world" as in Kernighan and Richie, your program should output your name (as it appears on your ID card) and the course number 22C:112. Your program must also include a header comment structured as follows, but with your name inserted appropriately:
/* MP1 by your name for 22C:060 */
The purpose of this assignment is to get you to use the departmental Linux servers, some text editor, and the C compiler. Your solution must be in a file named mp1.c (all lower case). Submit your solution using the coursework submission tools documented at:
-- http://www.divms.uiowa.edu/help/msstart/submit.html
In short, you will type the shell command submit, with no arguments, and when it prompts for a file name, you will type mp1.c, and then an extra carriage return to indicate that there is only one file in your submission. When it prompts for a course, type c_112 and finally, when it prompts for an assignment directory, enter mp1.