Professional Documents
Culture Documents
Midterm 01
Midterm 01
args
n (*)
i (*)
<
>
= (*)
//
4. In Alice, functions are dragged into the control statement, not the procedure.
True or false?
True
False (*)
5. From your Alice lessons, where should comments be placed?
False (*)
7. From your Alice lessons, comments do not affect the functionality or behavior
of objects. True or false?
True (*)
False
8. In Alice, inheritance means that the superclass inherits its traits from the
subclass. True or false?
True
False (*)
9. In Alice, declaring a new procedure to shorten code and make it easier to
read is a procedural abstraction technique. True or false
True (*)
False
10. In Alice, a person object inherits its procedures, functions, and properties
from which of the following classes
Object subclass
Quadruped class
13. In Alice, which of the following instructions turn the Blue Tang fish right one
half of a meter?
14. The move procedure moves an object in how many different possible
directions
6 (*)
A close friend
An object's orientation
Error handling
23. From your Alice lessons, how do you add an instance to a scene in Alice?
Select the instance from your computer's network.
Select the class, then drag the object into the scene. (*)
24. When you want specific code to be executed only if certain conditions are
met, what type of Java construct would you use
while loop
if (*)
array
boolean
Print "A", "B" and the value of num3 on the screen. (*)
26. From your Greenfoot lessons, abstraction techniques can only be used once
in a class's source code. True or false?
True
False (*)
27. From your Greenfoot lessons, which of the following are examples of
abstraction?
setImage
GreenfootImage
duke100.png (*)
new
30. Use your Greenfoot knowledge to answer the question: Where are defined
variables typically entered in a class's source code
In the defined method in the source code.
At the top of the source code, before the constructors and methods. (*)
31. In Greenfoot, a variable can be saved and accessed later, even if the
instance no longer exists. True or false ?
True
False (*)
32. From your Greenfoot lessons, when a method needs additional data to
perform a task, this data comes from parameters. True or false?
True (*)
False
33. In the Greenfoot IDE, which type of variable allows instances to store
information
Method variable
Class variable
World variable
34. From your Greenfoot lessons, how do you call a defined method?
Call the method from the act method. (*)
The gallery
36. 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
World method
Code method
getSound method
findSound method
importSound method
38. In Greenfoot, which method checks if a key on the keyboard has been
pressed
keyPress method
keyUp method
keyClick method
39. In the Greenfoot IDE, what symbols indicate that the variable is an array?
Square brackets [ ] (*)
Curly brackets { }
Semicolon ;
Colon :
i=1
i=i
i = i + 1 (*)
41. In Greenfoot, what happens if the end to a while loop isn't established?
The code will keep executing and will never stop. (*)
The code will execute once and then stop, due to controls in Greenfoot.
43. Use your Greenfoot skills to answer the question. What is incorrect in this
code?
Spacing missing
Comma missing
44. From your Greenfoot lessons, a problem statement defines the purpose for
your game. True or false
True (*)
False
45. From your Greenfoot lessons, where do you review a class's inherited
methods
Act method
Documentation (*)
Inspector
If-statement
46. From your Greenfoot lessons, the reset button resets the scenario back to its
initial position. True or false?
True (*)
False
47. Which of the following Java syntax is used to correctly create a Duke
subclass