Sie sind auf Seite 1von 17

Section 2 Quiz 1 - L1-L7

(Answer all questions in this section)


1. In Alice, new procedures are declared in the Scene editor. True or false?
Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 5.

2. Which of the following is a reason why procedural abstraction may be used in


programming an animation? Mark for Review
(1) Points

(Choose all correct answers)

The code is difficult to read. (*)

The programmer wants to save the animation.

The programmer wants to reuse the code. (*)

The code is too long. (*)

Incorrect. Refer to Section 2 Lesson 5.

3. In Alice, which of the following situations could benefit from declaring a new
procedure? Mark for Review
(1) Points

(Choose all correct answers)

An object needs to say three statements.

An object needs to move forward, then move up 10 meters.

Multiple objects need to use a motion, such as bunnies hopping. (*)

A single motion, such as walking, takes up a lot of room in myFirstMethod. (*)

An object does not have a default procedure for a motion, such as swimming.
(*)

Incorrect. Refer to Section 2 Lesson 5.

4. To add a procedure to myFirstMethod, right-click on the procedure you wish to add


and select the Add button. True or false? Mark for Review
(1) Points

True

False (*)
Incorrect. Refer to Section 2 Lesson 3.

5. In Alice, each class has a set of pre-defined procedures and functions. True or
false? Mark for Review
(1) Points

True (*)

False

Correct

6. In
Alice, Mark for Review
how (1) Points
would
you
get the
length
of a
fish
object?

getWidth

getLength

getHeight

getDepth (*)

Incorrect. Refer to Section 2 Lesson 7.

7. From your Alice lessons, which programming instruction represents the


following movement: A person moves forward the distance to the table, minus Mark for Review
the depth of the person. (1) Points

this.Table move Forward this.Person getDistanceTo this.Table - this.Table


getDepth
this.Person move Forward this.Person getDistanceTo this.Table +
this.Person getDepth
this.Person move Forward this.Person getDistanceTo this.Table -
this.Person getDepth (*)
this.Person move Forward this.Person getDistanceTo this.Table - this.Table
getDepth

Incorrect. Refer to Section 2 Lesson 7.

8. 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. (*)
All of the above

Incorrect. Refer to Section 2 Lesson 2.

9. One type of object property is an object's position in the scene. True or false?
Mark for Review
(1) Points

True (*)

False

Correct

10. It is important to save often while debugging your program. True or false?
Mark for Review
(1) Points

True (*)

False

Correct
11. In Alice,
each class Mark for Review
has a set (1) Points
of pre-
defined
procedures
and
functions.
True or
false?

True (*)

False

Correct

12. Which of the following would not be an argument in an Alice programming


instruction that commands a person object to move forward 2 meters? Mark for Review
(1) Points

Person's height (*)

Direction to move

Distance to move forward

Number of seconds to execute the programming instruction

Correct
13. What does a visual storyboard help the reader understand?
Mark for Review
(1) Points

(Choose all correct answers)

The components of the scene. (*)

The code that is debugged.

How the initial scene will be set up. (*)

The actions that will take place. (*)

Incorrect. Refer to Section 2 Lesson 5.

14. A flowchart is a useful way to illustrate how your Alice animation's


characters will look. True or false? Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 5.

15. In Alice, if a procedure is declared for a clownFish class, which classes can
use the procedure? Mark for Review
(1) Points

ClownFish class (*)

The pajamaFish class, clownFish class, and Swimmer class

The clownFish class and Swimmer class

Any class with "Fish" in the class name

Correct
1. As the Alice programmer, you render the animation on your own. True or false?
Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 12.

2. In Alice, as part of the recording process you can demonstrate the events that are
programmed within your animation. True or false? Mark for Review
(1) Points

True (*)

False

Correct

3. Which of the following elements of the Alice animation should be tested before
the animation is considered complete? Mark for Review
(1) Points

Math calculations operate as expected.

Objects move with smooth timing.

Comments are added to each sequence of instructions.

Control statements are operating as expected.

All of the above. (*)

Incorrect. Refer to Section 2 Lesson 12.

4. In Java code the { } brackets are used to represent what statements?


Mark for Review
(1) Points

(Choose all correct answers)

while

end (*)

begin (*)

for
Incorrect. Refer to Section 2 Lesson 10.

5. The initializer of a variable with a TextString value type could be (select all that
apply): Mark for Review
(1) Points

(Choose all correct answers)

"Greetings" (*)

"Howdy" (*)

"4" (*)

None of the above.

Incorrect. Refer to Section 2 Lesson 10.


6. In Alice,
which of the Mark for Review
following (1) Points
programming
statements
moves the
butterfly
forward,
double the
distance to
the tree?

this.Butterfly move forward {this.Butterfly getDistanceTo this.Tree


/ 2}
this.Butterfly move backward {this.Butterfly getDistanceTo
this.Tree / 2}
this.Butterfly move forward {this.Butterfly getDistanceTo this.Tree
* 2} (*)
this.Butterfly move backward {this.Butterfly getDistanceTo
this.Tree * 2}

Incorrect. Refer to Section 2 Lesson 9.

7. An example of an expression is:


Mark for Review
(1) Points

3*3=9 (*)

Move forward 1 meter

If or Where

"I feel happy."

Correct

8. The Alice IF control structure requires the false statement to be


populated. True or false? Mark for Review
(1) Points
True

False (*)

Incorrect. Refer to Section 2 Lesson 8.

9. In Alice, we use the WHILE control statement to implement the


conditional loop. True or false? Mark for Review
(1) Points

True (*)

False

Correct

10. Which one of the following event listener types is not available at the
top-level of the addEvent drop down list in Alice? Mark for Review
(1) Points

Collision (*)

Position/Orientation

Mouse

Keyboard

Correct
11.In Alice
it is not Mark for
possible Review
to
(1) Points
transfer
a class
from
one
animati
on to
another
. True
or
false?

True

False (*)

Incorrect. Refer to Section 2 Lesson 11.

12. Which of the following statements about what happens when the following code is
executed is false? Mark for
Review
(1) Points
The message "Printing Some Text" will be printed until loopVal is no longer
less than 5.
The variable loopVal is initialized to 0.

The condition loopVal < 5 is tested before the block is executed. (*)

The condition loopVal < 5 returns a boolean value.

None of the above.

Incorrect. Refer to Section 2 Lesson 14.

13. Which of the following statements about methods is false?


Mark for
Review
(1) Points

Methods whose return type is not void are required to include a return
statement specifying what to return.
Java does not permit nesting one method definition within another method's
definition.
Classes must be defined directly within a method definition. (*)

The order in which methods are listed within the class is not important.

Incorrect. Refer to Section 2 Lesson 14.

14. A typical application uses various values and these values continuously change
while the program is running. True or false? Mark for
Review
(1) Points

True (*)

False

Correct

15. If a value has been assigned to (is stored in) a variable, that value will be
overwritten when another value is assigned to the variable using the assignment Mark for
"=" operator. True or false? Review
(1) Points

True (*)
False

Correct
1. In the Greenfoot IDE, an instance's position is on the x and y coordinates. True or
false? Mark for Review
(1) Points

True (*)

False

Correct

2. An instance variable can be saved and accessed later, even if the instance no
longer exists. True or false? Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson 2.

3. In Greenfoot, the instance has a source code editor. True or false?


Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson 2.

4. Using the Greenfoot IDE, only five instances can be added to a scenario. True or
false? Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson 2.

5. In Greenfoot, which keyword calls the World superclass?


Mark for Review
(1) Points

constructor

new
addObject

super (*)

world

Incorrect. Refer to Section 3 Lesson 5.

6. The Greenfoot
method Mark for Review
getRandomNumber (1) Points
is used to create
predictable
behaviour in your
scenario

True

False (*)

Incorrect. Refer to Section 3 Lesson 5.

7. From your Greenfoot lessons, dot notation allows you to use a


method from a different class, if the class you are programming Mark for Review
does not possess the method. True or false? (1) Points

True (*)

False

Correct

8. 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

9. Which of the following type of audience should you ask to play your
Greenfoot game during the testing phase? Mark for Review
(1) Points

Primary

Programmer

Testing

Target (*)
Incorrect. Refer to Section 3 Lesson 4.

10. The list below displays components of the Greenfoot source code
editor except one. Which one should be removed? Mark for Review
(1) Points

Comments

Documentation

Method body

Class description

Instance creator (*)

Incorrect. Refer to Section 3 Lesson 3.

11. From
your Mark for Review
Greenfoot (1) Points
lessons,
where do
you
review a
class's
inherited
methods?

Documentation (*)

Act method

If-statement

Inspector

Correct

12. From your Greenfoot lessons, which of the following is not a step to
creating a new subclass? Mark for Review
(1) Points

Name the class.

Click New subclass...

Right-click on a superclass.

Select an image for the class.

Program the class to move forward. (*)

Incorrect. Refer to Section 3 Lesson 1.

13. A subclass has what kind of relationship to a superclass?


Mark for Review
(1) Points
"for-what"

"is-a" (*)

"is-by"

"a-is"

Correct

14. An object is an instance of a class. True or false?


Mark for Review
(1) Points

True (*)

False

Correct

15. In Greenfoot, a subclass is a specialization of a superclass. True or false?


Mark for Review
(1) Points

True (*)

False

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

2. From your Greenfoot lessons, which of the following logic operators represents
"and"? Mark for Review
(1) Points

&

&& (*)

Incorrect. Refer to Section 3 Lesson 10.

3. In a Greenfoot loop constructor, which component is a counter that controls how


many times the statement is executed? Mark for Review
(1) Points

Condition

Loop variable (*)

While loop

Local loop

Incorrect. Refer to Section 3 Lesson 10.

4. Which class holds the method that ends a Greenfoot game?


Mark for Review
(1) Points

Actor

Class

GreenfootImage

Greenfoot (*)
Incorrect. Refer to Section 3 Lesson 8.

5. In Greenfoot the showText() method belongs to which class?


Mark for Review
(1) Points

Actor

World (*)

There is no such method.

Greenfoot

Incorrect. Refer to Section 3 Lesson 8.


6. In
Greenfoot, Mark for Review
an if- (1) Points
statement
is used to
alternate
between
displaying
two
images in
an
instance.
True or
false?

True (*)

False

Correct

7. From your Greenfoot lessons, which one of the following is an example of


when an abstraction technique is used? Mark for Review
(1) Points

Passing a paramater in a constructor to set an initial speed. (*)

Adding a property to a Class

Initialising a variable

Adding a property to an instance

Incorrect. Refer to Section 3 Lesson 9.

8. In Greenfoot you can only access the methods of the current class?
Mark for Review
(1) Points

True

False (*)
Incorrect. Refer to Section 3 Lesson 9.

9. In Java what is casting?


Mark for Review
(1) Points

Casting is when we remove an object from the world

Casting is when we reset the state of an instance.

Casting is when we want to tell the java compiler that a class we are
accessing is really another type of class (*)
Casting is when we change the coordinates of an actor

Incorrect. Refer to Section 3 Lesson 9.

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

True (*)

False

Correct

11. In
Greenfoot, Mark for Review
which (1) Points
method
checks if a
key on the
keyboard
has been
pressed?

isKeyDown method (*)

keyClick method

isKeyUp method

keyPress method

Correct

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

True

False (*)

Incorrect. Refer to Section 3 Lesson 7.


13. 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

14. From your Greenfoot lessons, how do you call a defined method?
Mark for Review
(1) Points

Write the method in the instance.

Write the method in the Actor class.

Call the method from the act method. (*)

Write the method in the documentation.

Write the method in the World superclass.

Incorrect. Refer to Section 3 Lesson 6.

15. In Greenfoot, defined methods must be used immediately. True or false?


Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 3 Lesson 6.