Assignment 1, due Aug. 24
Part of
the homework for 22C:112, Fall 2012
|
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 lawyers 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) An integer global variable.
b) An floating point local variable.
c) A string constant.
d) A method of a class.
e) The method table shared by all members of a class in an object-oriented language.
a) Storing to a statically allocated global integer.
b) A conditional branch to another instruction in this subroutine.
c) Loading a local character.
d) Reference to a floating-point field of the record representing an object.
e) Calling a separately compiled subroutine resolved by the linker.
A question: Parnas uses a vehicle to illustrate the risks and benefits of transparency. What are the instructions that matter to his example in the "lower-level virtual machine" of this example, and what are the corresponding non-transparent instructions in the upper level? (1.0 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.