=========================preview======================
(COMP151)midterm_s2009.pdf
Back to COMP151 Login to download
======================================================
COMP151 Spring 2009

Midterm Examination March 28, 2009 2:00-4:00PM

structor: Prof C K Tang
In


Name: ________________K E Y__________________________

ID: _______________________________________________



Lecture Session (circle one): L1 L2


Lab Session (circle one):

La1A La1B La1C La1D La2A La2B La2C

(Your graded midterm will be given back during lab session)







Problem /
Suggested
time




Maximum

Your score


1 / 40min


Multiple Choice

40



2 / 15min


Object construction and destruction

15



3 / 15min


Shark Chase

15



4 / 10min


Object initialization

10



5 / 20min


Information hiding

20



Total


100




Multiple Choice
(+1 point for each correct answer, 0 point for no answer, -0.25 for each incorrect answer)

Important: We will only grade the letter you write in the space provided!

1. According to the Alice textbook, learning to program involves learning how to think about arranging a sequence of instructions to carry out a task.

a. True
b. False

Answer: __a___

2. Learning to program a computer turns someone into a computer nerd, according to the Alice authors.

a. True
b. False

Answer: __b___

3. A ____________ is a technique used by Alice programmers in designing a sequence of scenes.

a. storyboard
b. design layout
c. testing pack
d. reel

Answer: __a___

4. In computer terminology, a textual storyboard is called a(n) ____________.

a. program
b. test set
c. algorithm
d. scenario

Answer: __c___

5. Since the actions in a textual storyboard are often very close to actual program code, the statements in a textual storyboard are often known as ____________.

a. pseudocode
b. a design
c. a scenario
d. an implementation

Answer: __a___

6. Once a storyboard is created and the implementation step begins, the storyboard cannot be modified.

a. True
b. False

Answer: __b___

7. Program code involves various "pieces" (statements and phrases). For each piece, numbered 1 through 4, match the piece with its associated definition, labeled a through d.

_d__ 1. instruction
_c__ 2. control structure
_a__ 3. function
_b__ 4. expression

a. asks a question about a condition or computes a value
b. a math operation on numbers or other kinds of values
c. a statement that controls the execution of a block of instructions
d. a statement that executes to make objects perform a certain action

8. In the firstEncounter example described in the textbook, the task is to move a "spiderRobot" near a rock. Which solution below is the most effective?

a. experiment with moving the "spiderRobot" various distances wh