Sie sind auf Seite 1von 10

Section 1

(Answer all questions in this section)

1. From your Greenfoot lessons, which of the following are examples of when abstraction Mark for Review
techniques are used? (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 Mark for Review
achieved using the while loop? (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 Mark for Review
values to new instances each time the while loop executes and produces a new instance. (1) Points
True or false?

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 Mark for Review
you need to type into each array. True or false? (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.

Section 1
(Answer all questions in this section)

1. In Greenfoot, the sound file must be saved in the scenario and written in the source code for Mark for Review
it to play. True or false? (1) Points

True (*)
False

Correct

2. You cannot record unique sounds in Greenfoot. You can only use the sounds that are stored Mark for Review
in the Greenfoot library. True or false? (1) Points

True
False (*)

Incorrect. Refer to Section 3 Lesson 7.

3. What type of parameter does the keyDown method expect? Mark for Review
(1) Points
The password that will protect the class.
The name of the key to press on the keyboard. (*)
The name of the class that will use the key.
The name of the sound file to play when the key is pressed.

Incorrect. Refer to Section 3 Lesson 7.

Section 1
(Answer all questions in this section)

1. In Greenfoot, the sound file must be saved in the scenario and written in the source code for Mark for Review
it to play. True or false? (1) Points

True (*)
False

Correct

2. You cannot record unique sounds in Greenfoot. You can only use the sounds that are stored Mark for Review
in the Greenfoot library. True or false? (1) Points

True
False (*)

Incorrect. Refer to Section 3 Lesson 7.

3. What type of parameter does the keyDown method expect? Mark for Review
(1) Points

The password that will protect the class.


The name of the key to press on the keyboard. (*)
The name of the class that will use the key.
The name of the sound file to play when the key is pressed.

Incorrect. Refer to Section 3 Lesson 7.


Quiz 6
Section 1
(Answer all questions in this section)

1.In the Greenfoot IDE, any new methods you create are written in the Mark for Review
class's source code, below the act method. True or false?

True (*)
False

Correct

2.In reference to Mark for Review


Greenfoot, if
the following
method was
defined in a
superclass,

public void
lookForEdge()
{
...
}
all subclasses
of the
superclass will
inherit the
method.
True or false?

True (*)
False

Correct

Quiz 8
Section 1
(Answer all questions in this section)
1. In Greenfoot, which method body correctly adds an instance of the Mark for Review
World to a scenario, with size x = 300 y = 300 and a resolution of 2 (1) Points
pixels per cell?

world(300, 300, 2);


Super(300,300,2);
super(2,300,300);
super(300,300,2); (*)

Correct

2. A constructor is executed once in the course of a Greenfoot Mark for Review


scenario. True or false? (1) Points

True
False (*)

Correct

3. Which of the following Greenfoot programming statements creates Mark for Review
a new instance of Duke, and places him at x = 140, y = 130 in the (1) Points
world?

addObject(new( ), 140, 130);


addObject(new Duke( ), 140, 130); (*)
new(addObject(Duke ), 140, 130);
new(Duke( ) 140, 130);

Correct

4. Which keyword is used to add an actor to a Greenfoot world? Mark for Review
(1) Points

addObject
add
new (*)
super

Correct

5. Which of the following is the correct syntax for declaring a variable Mark for Review
in Greenfoot? (1) Points

(Choose all correct answers)

public variable-type variable-name; (*)


private variable-name, variable-type;
public variable-name variable type;
private variable-type variable-name; (*)

Correct

6. In Greenfoot, what is the purpose of the variable type? Mark for Review
(1) Points

Defines the access specifier used with the variable.


Defines what kind of data to store in the variable. (*)
Defines which class the variable is associated with.
Defines the instance that the variable is associated with.

Correct

7. Which operator is used to test if values are equal? Mark for Review
(1) Points

<
== (*)
>
!>

Correct

8. In Greenfoot, the == operator is used to test if two values are equal. Mark for Review
True or false? (1) Points

True (*)
False

Correct

9. The GreenfootImage class enables Greenfoot actors to maintain Mark for Review
their visible image by holding an object of type GreenfootImage. (1) Points
True or false?

True (*)
False

Correct

10.What does the following programming statement mean? Mark for Review
(1) Points
image1 = new GreenfootImage("duke12.png );

The variable, image1, cannot use the image file, duke12.png.


The image file, duke12.png, has just been drawn and imported
into the scenario.
The image file, duke12.png, is assigned to the variable image1.
(*)
Image files from 1-119 are associated with image1.

Correct

11.In Greenfoot, which method is used to end a game? Mark for Review
(1) Points

Class.stop( );
Greenfoot.stop( ); (*)
Duke.stop( );
Game.stop(1);

Correct

12.Where can we review the available classes and methods in Mark for Review
Greenfoot, including the stop method? (1) Points

Class menu
Object menu
Class Application Programmers' Interface (API)
Greenfoot Application Programmers' Interface (API) (*)

Correct

Das könnte Ihnen auch gefallen