Professional Documents
Culture Documents
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 1
(Answer all questions in this section)
1.
In Greenfoot, which method body correctly adds an instance of the World to a scenario, with size
x = 300 y = 300 and a resolution of 2 pixels per cell?
a. world(300, 300, 2);
b. Super(300,300,2);
c. super(2,300,300);
d. super(300,300,2); (*)
2.
3.
Which of the following Greenfoot programming statements creates a new instance of Duke, and
places him at x = 140, y = 130 in the world
a. addObject(new( ), 140, 130);
b. addObject(new Duke( ), 140, 130); (*)
c. new(addObject(Duke ), 140, 130);
d. new(Duke( ) 140, 130);
4.
5.
Which of the following is the correct syntax for declaring a variable in Greenfoot?
(Choose all correct answers)
a. public variable-type variable-name; (*)
b. private variable-name, variable-type;
c. public variable-name variable type;
d. private variable-type variable-name; (*)
6.
7.
8.
In Greenfoot, the == operator is used to test if two values are equal. True or false
a. True (*)
b. False
9.
The GreenfootImage class enables Greenfoot actors to maintain their visible image by holding an
object of type GreenfootImage. True or false
a. True (*)
b. False
10.
a.
b.
c.
d.
11.
12.
Where can we review the available classes and methods in Greenfoot, including the stop method?
a. Class menu
b. Object menu
c. Class Application Programmers' Interface (API)
d. Greenfoot Application Programmers' Interface (API) (*)
1. From your Greenfoot lessons, which of the following are examples of actions that can be achieved
using the while loop?
2. Which of the
following is not a
component of a
while loop?
Mark for
Review
(1) Points
Local variable
Control operator
Loop variable
if statement (*)
while keyword
Incorrec
t. Refer
to
Section
3
Lesson
10.
3. If an end to a while
loop is not
established, what
happens?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
True (*)
False
Correct
5. An array is an object
that holds multiple
methods. True or
false?
Mark for
Review
(1) Points
True
False (*)
Incorrec
t. Refer
to
Section
3
Lesson
10.
6. In Greenfoot, arrays
are a way to hold
and access multiple
variables, and assign
different values to
new instances each
time the while loop
executes and
produces a new
instance. True or
false?
Mark for
Review
(1) Points
True (*)
False
Incorrec
t. Refer
to
Section
3
Lesson
10.
7. Which of the
following Greenfoot
logic operators
represents "not"?
&
Mark for
Review
(1) Points
&&
=
! (*)
Incorrec
t. Refer
to
Section
3
Lesson
10.
8. In the Greenfoot IDE,
what does the AND
operator (&&) do?
Mark for
Review
(1) Points
Compares two
boolean values,
and returns a
boolean value
which is true if
and only if both
of its operands
are true. (*)
Compares two
boolean values,
and returns a
boolean value
which is true if
and only if one
of its operands
are true.
Compares two
boolean values
and returns a
boolean value
which is true if
either one of the
operands is
true.
Compares two
boolean
variables or
expressions and
returns a result
that is true if
either of its
operands are
true.
Incorrec
t. Refer
to
Section
3
Lesson
10.
9. In Greenfoot, a local
variable is declared
at the beginning of a
class. True or false?
Mark for
Review
(1) Points
True
False (*)
Correct
10. In Greenfoot, what
types of values
cannot be stored in a
local variable?
Mark for
Review
(1) Points
Class name
Objects
Integers
World name
Method (*)
Correct
11. In Greenfoot, string
concatenation
reduces the number
of redundant
characters or
phrases you need to
type into each array.
True or false?
Mark for
Review
(1) Points
True (*)
False
Incorrec
t. Refer
to
Section
3
Lesson
10.
12. Which of the
following is an
example of string
concatenation?
Mark for
Review
(1) Points
Instead of
entering ".png"
after each
image file name,
add && ".png"
after the
imageName
value in the
programming
statement.
Instead of
entering ".png"
after each
image file name,
add = ".png"
after the
imageName
value in the
programming
statement.
Instead of
entering ".png"
after each
image file name,
add + ".png"
after the
imageName
value in the
programming
statement. (*)
Instead of
entering ".png"
after each
image file name,
add ".png" after
the imageName
value in the
programming
statement.
1From
. your
Greenfo
ot
lessons
, the
________
__
control
structur
e is
used to
compar
e and
make a
decisio
n.
Conditional (*)
Repetition
Obsolete
Rewind
Incorrect. Refer to Section 3 Lesson 12.
2.
From your Greenfoot lessons, the __________ control structure is often referred
to as loops.
Mark for
Review
(1) Points
Conditional
Repetition (*)
Obsolete
Rewind
Correct
3.
The construct listed below is described as a __________________.
/**
* Get value and store in variable
*/
Mark for
Review
(1) Points
Method
Comment (*)
Variable Assignment
Instruction
Correct
4.
The construct listed below is described as a __________________.
termvar = scanterm.nextLine();
Method
Comment
Variable Assignment (*)
Instruction
Incorrect. Refer to Section 3 Lesson 12.
5.
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
2
3 (*)
4
5
6
Incorrect. Refer to Section 3 Lesson 12.
7.
In which step to create a Greenfoot game do you find and resolve errors in
the game?
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points
Mark for
Review
(1) Points