Professional Documents
Culture Documents
Midterm1 var 2 1
14. Define the value of the variable NumSpins based on the following math calculation:
NumSpins / 3 = 8
12 24 (*) 8 NumSpins
15. From your Alice lessons, the "Checklist for Animation Completion" does not ask questions
about the scenario and storyboards, because these are not valid parts of the animation creation
process. True or false? True False (*)
6. From your Alice lessons, which control statement executes instructions simultaneously?
Do in order
Count
Variable
Do together (*)
17. In Alice, which of the following instructions roll the Blue Tang fish left 1 meter?
this.blueTang roll Left 1.0 (*)
this.blueTang Left 1.0
this.blueTang Left 1
this.blueTang roll Left 1
19. Expressions with relational operators produce true and false values. True or false?
True (*) False
20. In Alice, where are arithmetic operators available?
Amount argument (*)
Size argument
Duration argument (*)
Get Distance functions (*)
If control
21. Which of the following is not an example of the logic of an IF control structure?
Play the video three times. (*)
If the play button is pressed, then play the video one time.
If the doorbell rings, then the door opens.
If the bird rings the bell, a treat is dispensed.
Midterm1 var 2 2
In the Greenfoot image gallery
In the scene editor
29. What does the following Greenfoot programming statement do? turn(18);
Turn the object 36 degrees.
Turn the object 18 degrees. (*)
Turn the object 18 steps forward.
Move the object 18 steps forward.
30. In the Greenfoot IDE, which type of variable allows instances to store information?
Method variable
Instance variable (*)
Class variable
World variable
31. Use your Greenfoot knowldege: Abstraction occurs in many different ways in programming.
True or false? True (*) False
32.From your Greenfoot lessons, abstraction techniques can only be used once in a class's source
code. True or false? True False (*)
33. From your Greenfoot lessons, what are the ways that you can view a class's methods?
In the scenario
In the class's documentation (*)
By right-clicking on an instance (*)
In the Greenfoot gallery
35. In Greenfoot, dot notation is used to call a _____________ from another class.
Method (*)
Class
Signature
Parameter
36. In Greenfoot, defined methods must be used immediately. True or false?
True False (*)
37. From your Greenfoot lessons, how do you call a defined method?
Call the method from the act method. (*)
Call the method from the defined method.
Write the method in the World superclass.
Write the method in the instance.
Write the method in the source code.
38. From your Greenfoot lessons, to save space in the act method, you can write an entirely new
method below it, called a _____________.
Class method
Instance method
Defined method (*)
World method
Code method
39. When a Greenfoot code segment is executed in an if-statement, each line of code is executed in
sequential order. True or false? True (*) False
Midterm1 var 2 3
40. From your Greenfoot lessons, which type of constructor can be used to automate creation of
Actor instances?
Animal
World (*)
Actor
Vector
41. From your Greenfoot lessons, when does an if-else statement execute it's second code segment?
When a random number is less than 10.
When an instance is created.
After the first code segment is executed.
If a condition is false. (*)
If a condition is true.
42. From your Greenfoot lessons, which symbol represents string concatenation?
Symbol &
Symbol <
Symbol =
Symbol + (*)
43. How would the following sentence be written in Greenfoot source code? If Duke's leg is down,
and the keyboard key "d" is down...
if (&&isDown ! Greenfoot.isKeyDown("d") )
if (!isDown && Greenfoot.isKeyDown("d") )
if (isDown && Greenfoot.isKeyDown("d") ) (*)
if (!Greenfoot.isKeyDown && isDown("d") )
44. Use your Greenfoot knowledge to answer the question: String concatenation is a way to avoid
having to write additional characters in your source code. True or false?
True (*) False
45. In Greenfoot, which method is used to add a new instance to a scenario when the world is
initialized?
addClass
addWorld
addObject (*)
addInstance
46. In Greenfoot, an if-statement is used to alternate between displaying two images in an instance.
True or false? True False (*)
47. In Greenfoot, a constructor has a void return type. True or false? True False (*)
48. From your Greenfoot lessons, a problem statement defines the purpose for your game. True or
false? True (*) False
49. In Greenfoot, what type of parameter does the keyDown method expect?
String (*)
Boolean
Integer
Method
50. In Greenfoot, which method checks if a key on the keyboard has been pressed?
keyPress method
keyUp method
keyDown method (*)
keyClick method
Midterm1 var 2 4