You are on page 1of 4

Section 1

(Answer all questions in this section)


1. From your Greenfoot lessons, which of the following are examples of when
abstraction techniques are used? Mark for Review
(1) Points
Assigning a sound file to an instance.

Assigning a keyboard key to an instance.

Assigning an image file to an instance.

All of the above. (*)

Correct

2. Abstraction occurs in many different ways in programming. True or false?


Mark for Review
(1) Points
True (*)

False

Correct
Section 1
(Answer all questions in this section)
1. From your Greenfoot lessons, which of the following are examples of actions that
can be achieved using the while loop? Mark for Review
(1) Points
Create 50 instances of the Duke class.

Call the move method 1 million times.

Call the move and turn methods 10 times.

Create 100 instances of an Actor subclass.

All of the above. (*)

Correct

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

Incorrect. Refer to Section 3 Lesson 10.

3. If an end to a while loop is not established, what happens?


Mark for Review
(1) Points
The code stops after 10 executions.

The code stops after 20 executions.

The condition becomes false after one minute of executions.

The code executes and does not stop. (*)

Correct

4. Infinite loops are a common cause of errors in programming. True or false?


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 (*)

Incorrect. 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 Mark for Review
a new instance. True or false? (1) Points
True (*)

False

Correct

7. Which of the following Greenfoot logic operators represents "not"?


Mark for Review
(1) Points
&

&&

! (*)

Incorrect. 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.
Correct

9. In Greenfoot, a local variable is declared at the beginning of a class. True or


false? Mark for Review
(1) Points
True

False (*)

Incorrect. Refer to Section 3 Lesson 10.

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 (*)

Incorrect. Refer to Section 3 Lesson 10.

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

Correct

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.
Incorrect. Refer to Section 3 Lesson 10.

You might also like