Professional Documents
Culture Documents
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct
answer.
Section 2
(Answer all questions in this section)
1 In Alice, procedural abstraction is the concept of making code easier to
. understand and reuse. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
2 In Alice, if a procedure is declared for a clownFish class, which classes
. can use the procedure?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Visual storyboard
Flowchart (*)
Pie chart
Scene editor
Class chart
Mark for
Review
(1) Points
getObject
getDuration
getDepth
getDistance (*)
Incorrect. Refer to Section 2 Lesson 7.
5Which of the following statements about what happens when the
. following code is executed is false?
Mark for
Review
(1) Points
different
message
to display
if the
user is 18
or older,
what type
of
construct
would
you use?
for all loop
do loop
while loop
if (*)
Incorrect. Refer to Section 2 Lesson
14.
7. The Alice IF control structure requires the false statement to
be populated. True or false?
True
False (*)
Correct
8. In Alice, Do In Order and Do Together:
True (*)
False
Incorrect. Refer to Section 2 Lesson
6.
10. Which of the following actions would require a control
statement to control animation timing?
12. From your Alice lessons, variables are fixed and cannot be changed.
True or false?
Mark for
Review
(1) Points
True
False (*)
Correct
13. Which of the following programming instructions commands the fish
to continuously move forward a random speed between 0.5 and 1.0
meters, minus 0.25 meters, until it collides with the shark?
(*)
Mark for
Review
(1) Points
Correct
14. From your Alice lessons, what does the Count control statement do?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
Section 2
(Answer all questions in this section)
16.From your Alice lessons, at what point in the animation process do
you confirm the items on the "Checklist for Animation Completion"?
True
False (*)
Incorrect. Refer to Section 2 Lesson 3.
18.From your Alice lessons, complete the following sentence: When
coded, an event triggers a ___________.
Infinite loop
Gallery
Procedure (*)
Scene
Correct
19.In Alice, which of the following programming statements moves the
butterfly forward, double the distance to the tree?
this.Fish - 2}
this.Rock move forward {this.Rock getDistanceTo this.Fish this.Fish - 2}
Correct
2Examine the following code. What are the variables?
1.
Mark for
Review
(1) Points
/
*
%
None of the above
(*)
Corre
ct
Section 3
(Answer all questions in this section)
23. From your Greenfoot
lessons, source code is
written in the Code
editor. True or false?
Mark for
Review
(1) Points
True (*)
False
Corre
ct
24. In Greenfoot, what
happens if the
condition is false in an
if-statement?
The programming
statements are
executed.
The if-statement is
executed.
The act method is
deleted.
The programming
statements are not
executed. (*)
Corre
ct
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Incorr
ect.
Refer
to
Sectio
n3
Lesso
n6
Mark for Review
26.From
your
Greenfoot
lessons,
how do
you call a
defined
method?
(1) Points
Mark for
Review
(1) Points
Testing
Target (*)
Primary
Programmer
Incorrect. Refer to Section 3 Lesson
4.
28. From your Greenfoot lessons, a problem statement defines
the purpose for your game. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
29. Using Greenfoot, how do we change the size and resolution
of the World instance?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
31.Using the
Greenfoot
IDE, when is
a constructor
automatically
executed?
Mark for
Review
(1) Points
Methods
Classes
Integers (*)
Scenarios
Incorrect. Refer to Section 3
Lesson 2.
33. In Greenfoot, the properties of an instance can be
modified in the documentation. True or false?
Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3
Lesson 2.
34. From your Greenfoot lessons, which of the following are
properties of an instance?
Mark for
Review
(1) Points
Size
Color
Image file
Methods
All of the above (*)
Mark for
Review
(1) Points
void turnLeft()
()
void
turnLeft (*)
Left
Correct
36.From your
Greenfoot
lessons,
which of the
following is
not a
characteristic
of a static
method?
Mark for
Review
(1) Points
38. When a Greenfoot code segment is executed in an ifstatement, each line of code is executed in sequential
order. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
39. In Greenfoot, you can use comparison operators to
compare a variable to a random number. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
40. From your Greenfoot lessons, the keyDown method is
located in which class?
Mark for
Review
(1) Points
Actor
Greenfoot (*)
GreenfootImage
World
Correct
41.From
your
Greenfoot
lessons,
which of
the
following
is not a
step to
creating a
new
subclass?
Right-click on a superclass.
Click New subclass...
Name the class.
Select an image for the class.
Program the class to move forward. (*)
Incorrect. Refer to Section 3 Lesson
1.
42. From your Greenfoot lessons, a scenario is a game or
simulation implemented in Greenfoot. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
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...
Mark for
Review
(1) Points
if (&&isDown ! Greenfoot.isKeyDown("d") )
if (!isDown && Greenfoot.isKeyDown("d") )
if (isDown && Greenfoot.isKeyDown("d") ) (*)
if (!Greenfoot.isKeyDown && isDown("d") )
Correct
44. From your Greenfoot lessons, what is a loop?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
keynames[2]
keynames["a"]
keynames[0] (*)
keynames["a" key]
Correct
4From your Greenfoot lessons, which line of code is missing something?
7.
Mark for
Review
(1) Points
1
3 (*)
4
5
6
Correct
4In Greenfoot, the image below is an example of what construct?
8.
Mark for
Review
(1) Points
Method
Comment
Constructor (*)
Class
Incorrect. Refer to Section 3 Lesson 12.
4Use your Greenfoot skills to answer the question. What is incorrect in this
9.code?
Mark for
Review
(1) Points
Spacing missing
Curly brace missing
Parenthesis missing (*)
Comma missing
Correct
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 4.
2. Which of the following is not an Alice variable value type?
Mark for
Review
(1) Points
Color
Decimal Number
Whole Number
Function (*)
Incorrect. Refer to Section 2 Lesson 10.
3. A variable is a named location inside the computer's memory; once there,
the information can be retrieved and changed. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
4. In Alice, which of the following programming statements moves the fish
forward, the distance to the rock, minus the depth of the rock?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Infinite loop
Gallery
Procedure (*)
Scene
Correct
Mark for
Review
(1) Points
True
False (*)
Correct
8. All objects in Alice have three dimensional coordinates on which
axes?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 2 Lesson 12.
10. From your Alice lessons, animations should be tested by the
programmer before they are considered complete. True or false?
Mark for
Review
(1) Points
True (*)
False
Incorrect. Refer to Section 2 Lesson 12.
while loop
if (*)
array
boolean
Correct
12. Which of the following statements about methods is false?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True (*)
False
Correct
14. From your Alice lessons, which of the following are types of
storyboards?
Mark for
Review
(1) Points
(Choose all correct answers)
Actual
Textual (*)
Factual
Visual (*)
Fictional
Incorrect. Refer to Section 2 Lesson 5.
15. Defining the scenario, and the Alice animation to represent the
scenario, is the first step to programming your animation. True or
false?
Mark for
Review
(1) Points
True (*)
False
Incorrect. Refer to Section 2 Lesson 5.
16. Which of
the
following
actions
would
require a
control
statemen
t to
control
animatio
n timing?
Mark for
Review
(1) Points
Are move statements
Are control statements (*)
Are complex statements
None of the above
Correct
18. In Alice, the setVehicle procedure will associate one object to
another. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
19. Which of the following does not describe variables?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
1
4
3
6 (*)
Correct
22. From your Alice lessons, which programming instruction represents
the following movement: A cat moves forward double (or twice) the
distance to the tree.
Mark for
Review
(1) Points
Section 3
(Answer all questions in this section)
23. From your Greenfoot lessons, which of the following is an example
of a type of data passed through a parameter?
Mark for
Review
(1) Points
Methods
Classes
Integers (*)
Scenarios
Correct
24. From the Greenfoot IDE, where are inherited methods located?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
orientTo( );
turnAround( );
move ( );
turn( ); (*)
Correct
From
26. your
Greenfoo
t lessons,
instances
do not
have any
memory.
True or
false?
True
False (*)
Correct
27. From your Greenfoot lessons, which type of constructor can be used
to automate creation of Actor instances?
Mark for
Review
(1) Points
Animal
World (*)
Actor
Vector
Correct
28. From your Greenfoot lessons, which of the following comparison
operators represents "greater than"?
Mark for
Review
(1) Points
> (*)
<
==
!=
Correct
29. From your Greenfoot lessons, which axes define an object's position
in a world?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
31. In
Greenfoot
, what is a
common
letter
used for
the loop
variable?
A
I (*)
X
Y
Correct
32. In Greenfoot, when is a local variable most often used?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
34. In Greenfoot, what happens if the end to a while loop isn't
established?
Mark for
Review
(1) Points
The code will keep executing and will never stop. (*)
The code will execute once and then stop, due to controls in
Greenfoot.
The code will prompt you to enter a loop counter.
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Correct
38. From your Greenfoot lessons, what are the ways that you can
view a class's methods?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Act method
Documentation (*)
Inspector
If-statement
Correct
40. Using the Greenfoot IDE, which of the following programming
statements tells the object to turn 38 degrees?
Mark for
Review
(1) Points
move():
move(2);
turn(38); (*)
turn(38):
Correct
From
41. your
Greenfoo
t
lessons,
how do
you test
that your
code
does not
contain
bugs?
Write the code.
Inspect the instances.
Review the documentation.
Compile the code. (*)
Correct
42. In Greenfoot, which of the following are execution controls?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
44. We can use the Actor constructor to automatically create Actor
instances when the Greenfoot world is initialized. True or false?
Mark for
Review
(1) Points
True
False (*)
Correct
45. From your Greenfoot lessons, where should the stop method be
inserted into the source code?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True
False (*)
Correct
49. In Greenfoot, a way to have all subclasses of a superclass inherit a
method is by adding the method to the superclass. True or false?
Mark for
Review
(1) Points
True (*)
False
Correct
50. Use your Greenfoot knowledge to answer the question. One reason
to write a defined method in a class is to change the behavior of the
class. True or false?
Mark for
Review
(1) Points
True
False (*)
Incorrect. Refer to Section 3 Lesson 6.
1.
In Alice, a computer program requires functions to tell it how to perform the
procedure. True or false? Mark for Review
(1) Points
True
False (*)
2.
(1) Points
Are move statements
Are control statements (*
Are complex statements
None of the above
3.
In Alice, the procedures' arguments allow the programmer to adjust the
object, motion, distance amount, and time duration. True or false?
Mark for
Review
(1) Points
True (*)
False
4.
A conditional loop is a loop that will continue forever. True or false?
for Review
Mark
(1) Points
True
False (*)
5.
Which of the following programming instructions commands the fish to
continuously move forward a random speed between 0.5 and 1.0 meters, minus
0.25 meters, until it collides with the shark? Mark for Review
(1) Points
6.
Define the value of the variable LapCount based on the following math
calculation: LapCount + 10 = 15 Mark for Review
(1) Points
2
4
5 (*)
15
10
7.
In Alice, which of the following programming statements moves
the cat backward, half the distance to the bird?
Mark for Review
(1) Points
Correct
Correct
8.
Review
(1) Points
Mark for
Incorrect
9.
If the value already exists in the variable it is overwritten by the
assignment operator (=). True or false?
Mark for Review
(1) Points
True (*)
False
Correct
Correct
10.
Review
(1) Points
<
Mark for
// (*)
>
Correct
Correct
11.
Which of the following are examples of elements you would test in your Alice
animation? Mark for Review
(1) Points
Incorrect
12.
From your Alice lessons, a textual storyboard provides a
detailed, ordered list of the actions each object performs in each scene of the
animation. True or false? Mark for Review
(1) Points
True (*)
False
Correct
Correct
13.
You have a Class representing Cat. Each Cat can meow, purr,
catch mice, and so on. When you create a new cat, what is it called?
Mark for
Review
(1) Points
A submethod
A subprogram
An instance (*)
A subclass
A variable class
Incorrect
14.
(1) Points
An instance
A method (*)
A class
A variable
Incorrect
15.
In Alice, how is a one-shot procedure different from procedures
in the Code editor? Mark for Review
(1) Points
One-shot procedures are only available for acting objects, while procedures
are available for all objects.
One-shot procedures are available in the Code editor, while procedures are
available in the Scene editor.
A one-shot procedure executes only one time to re-position the object, while
procedures in the Code editor execute every time the Run button is clicked. (*)
16.
In Alice, which function is used to move an object directly to the center point
of another object? Mark for Review
(1) Points
getObject
getDuration
getDepth
getDistance (*)
Correct
Correct
17.
In Alice, if a procedure is declared for a clownFish class, which
classes can use the procedure? Mark for Review
(1) Points
Correct
Correct
18.
From your Alice lessons, which of the following is a tool to show
the logic of an animation? Mark for Review
(1) Points
Visual storyboard
Flowchart (*)
Pie chart
Scene editor
Class chart
Incorrect
19.
From your Alice lessons, inheritance means that the superclass
inherits its traits from the subclass. True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect
20.
In Alice, each class has a set of pre-defined procedures and
functions. True or false? Mark for Review
(1) Points
True (*)
False
21.
From your Alice lessons, what does the Count control statement do?
for Review
(1) Points
Mark
Correct
Correct
22.
From your Alice lessons, complete the following sentence: When
coded, an event triggers a ___________. Mark for Review
(1) Points
Infinite loop
Gallery
Procedure (*)
Scene
Correct
Correct
Section 3
(Answer all questions in this section)
23.
In Greenfoot, you may perform the programming tasks of create
and test many times. True or false?
Mark for Review
(1) Points
True (*)
False
Correct
Correct
24.
From your Greenfoot lessons, which of the following is an
example of changing the environment during a Q/A test cycle?
Mark for Review
(1) Points
Incorrect
25.
Programming tasks to create a Greenfoot game typically occur
in the following order:
True or false?
(1) Points
True (*)
False
26.
From your Greenfoot lessons, in an if-statement, the programming
statements written in curly brackets are executed simultaneously. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
Correct
27.
In Greenfoot, a method with what kind of return type is used to
learn more about an object's orientation?
Mark for Review
(1) Points
Incorrect
28.
From your Greenfoot lessons, abstraction techniques can only be
used once in a class's source code. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
Correct
29.
In Greenfoot, which method is used to add a new instance to a
scenario when the world is initialized? Mark for Review
(1) Points
addClass
addWorld
addObject (*)
addInstance
Correct
Correct
30.
In Greenfoot, constructors can be used to create new instances
of objects. True or false? Mark for Review
(1) Points
True (*)
False
31.
When you re-initialize a scenario, Greenfoot automatically displays an
instance of the World subclass in the scenario. True or false?
Mark for Review
(1) Points
True (*)
False
Incorrect
32.
In the Greenfoot IDE, which of the following is not a property of
an instance? Mark for Review
(1) Points
Position
Inherited methods
Defined methods
Incorrect
33.
From your Greenfoot lessons, which of the following is an
example of a type of data passed through a parameter?
Mark for Review
(1) Points
Methods
Classes
Integers (*)
Scenarios
Correct
Correct
34.
From your Greenfoot lessons, which of the following are
properties of an instance? Mark for Review
(1) Points
Size
Color
Image file
Methods
Incorrect
35.
From your Greenfoot lessons, instances do not have any
memory. True or false?
Mark for Review
(1) Points
True
False (*)
36.
In Greenfoot, you will not receive an error message if your code is incorrect. It
will simply not work, and you will have to determine why the code doesn't work.
True or false?
Mark for Review
(1) Points
True
False (*)
Correct
Correct
37.
Which of the following type of audience should you ask to play
your Greenfoot game during the testing phase?
Mark for Review
(1) Points
Testing
Target (*)
Primary
Programmer
Incorrect
38.
From your Greenfoot lessons, the reset button resets the
scenario back to its initial position. True or false?
Mark for Review
(1) Points
True (*)
False
Incorrect
39.
From your Greenfoot lessons, an instance inherits all of the
characteristics of the class, and those characteristics cannot be changed. True or
false? Mark for Review
(1) Points
True
False (*)
Correct
Correct
40.
In the following Greenfoot array, what statement would you
write to access the "a" key?
keynames[2]
keynames["a"]
keynames[0] (*)
keynames["a" key]
41.
In a Greenfoot loop constructor, which component is a counter that controls
how many times the statement is executed? Mark for Review
(1) Points
Local loop
While loop
Condition
Correct
Correct
42.
for Review
(1) Points
Mark
Incorrect
43.
From your Greenfoot lessons, when do infinite loops occur?
Mark for Review
(1) Points
Incorrect
44.
In Greenfoot, you can use comparison operators to compare a
variable to a random number. True or false? Mark for Review
(1) Points
True (*)
False
Incorrect
45.
From your Greenfoot lessons, dot notation allows you to use a
method from a different class, if the class you are programming does not possess
the method. True or false?
Mark for Review
(1) Points
True (*)
False
46.
From your Greenfoot lessons, which programming statement creates a new
Duke object, and places it at x = 120, y = 100 in the world?
Mark for Review
(1) Points
Move(120,100);
Incorrect
47.
Use you Greenfoot knowledge: What range of numbers does the
following method return?
Greenfoot.getRandomNumber(30)
(1) Points
Incorrect
48.
Greenfoot does not have tools to record sound. True or false?
Mark for Review
(1) Points
True
False (*)
Correct
Correct
49.
From your Greenfoot lessons, how do you call a defined method?
Mark for Review
(1) Points
Incorrect
50.
Use your Greenfoot knowledge to answer the question. One
reason to write a defined method in a class is to change the behavior of the class.
True or false?
Mark for Review
(1) Points
True
False (*)
Incorrect
MIDTERM 1 VAR 2
1. In Alice, we can avoid object collision using what?
Slowing movements down.
Using math operators. (*)
Downloading the Alice3 collision detector app.
Using object detection.
2. From your Alice lessons, which of the following are examples of scenarios?
13. The value that a variable holds must be a whole number, not a decimal. True or false?
True
False (*)
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
18. How do you copy an Alice procedure?
Drag the procedure into the clipboard, then click CTRL + C.
Hold down the control (CTRL) key, then drag the procedure into the clipboard. (*)
Drag the procedure into the clipboard.
Select Copy in the Run menu.
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.
22. The condition in a WHILE loop is a boolean expression. True or false?
True (*)
False
23. What Alice tool can be used to diagram the If conditional execution statement?
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
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
MIDTERM
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
12. From your Alice lessons, random numbers are set in the distance and duration
arguments in a procedure. True or false
True (*)
False
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 :
40. In Greenfoot, which of the following statements could prevent an infinite loop
from occurring?
I = 100 + i
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
50. Read the following method signature. Using your Greenfoot experience, what
does this method do?
public static int getRandomNumber (int limit)
Returns a random number less than 10.