Sie sind auf Seite 1von 23

1.

In an
Alice Mark for Review
program, (1) Points
which
code is
executed
when
the Run
button is
clicked?

The code entered in myMethod in the Code editor.

The code entered in the class's procedure in the procedures tab.

The one-shot procedures selected in the Scene editor.

The code entered in myFirstMethod in the Code editor. (*)

Incorrect. Refer to Section 2 Lesson 3.

2. When you disable a programming instruction, it is still executed when


you run the Alice animation. True or false? Mark for Review
(1) Points

True

False (*)

Correct

3. Debugging and testing is the process of running the animation one time,
and adjusting the control statements, procedures, and arguments. Mark for Review
(1) Points

True

False (*)

Incorrect. Refer to Section 2 Lesson 3.

4. In Alice, which of the following is not a control statement?


Mark for Review
(1) Points

Count

While
Move (*)

Do In Order

Incorrect. Refer to Section 2 Lesson 6.

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

Correct
6. After objects are
positioned in the Mark for Review
scene, it is wise to (1) Points
save multiple
versions of the
project, giving
each version the
same name. True
or false?

True
False (*)

Incorrect. Refer to Section 2 Lesson 1.

7. 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. Refer to Section 2 Lesson 5.

8. In Alice, new procedures are declared in the Scene editor. True or


false? Mark for Review
(1) Points

True
False (*)

Correct

9. Which of the following would a clown fish object in Alice inherit from its
class? Mark for Review
(1) Points
Fins
Two eyes
Procedures
Functions
All of the above (*)

Incorrect. Refer to Section 2 Lesson 5.

10. When you edit an object's properties in the Scene editor, the changes
do not take effect until the Run button is clicked. True or false? Mark for Review
(1) Points

True
False (*)

Correct

11. Alice objects move


relative to the Mark for Review
orientation of the (1) Points
person viewing the
animation. True or
false?

True

False (*)

Incor

12. From your Alice lessons, which programming instruction represents the following movement: A turtle moves forwar

this.Turtle move Forward this.Turtle getDistanceTo this.Flower / 2.0 (*)

this.Turtle move Forward this.Turtle getDistanceTo this.Flower * 2

this.Turtle move Forward this.Turtle getDistanceTo this.Flower / 1.0

this.Turtle move Forward this.Turtle getDistanceTo this.Flower / 0.5

Corre

13. In Alice, what function would you use to get a wholenumber from the user?
getStringFromUser

getBooleanFromUser

getDoubleFromUser

getIntegerFromUser (*)

Incor

14. The first step to using a top-down approach to programming is to create a table to align the storyboard steps to th

True

False (*)

Incor

15. A complete Alice instruction includes which of the following components?

(Choose all correct answers)

Image

Class

Direction (*)

Procedure (*)

Amount (*)

1. Which of
the Mark for Review
following (1) Points
is not a
relational
operator?

<
>
// (*)
=

Correct

2. Examine the following code. What are the variables?


(Choose all correct answers)

i (*)
n (*)
args (*)
t (*)

Correct

3. Alice provides pre-populated worlds through which new menu tab?

Starters (*)
File System
Blank Slates
Recent

Correct

4. Which of the following is not a type of event listener in Alice?

Scene Activation/Time
Cursor (*)
Keyboard
Position/Orientation
Mouse

Incorrect. Refer to Section


5. In Alice, which of the following programming statements moves the cat forward the distance to the bird?

this.Cat move {this.Bird getDistanceTo this.Cat / 2}


this.Cat move forward {this.Bird getDistanceTo this.Cat / 2}
this.Bird move forward {this.Bird getDistanceTo this.Cat}
this.Cat move forward {this.Cat getDistanceTo this.Bird} (*)
6. Alice uses
built-in Mark for Review
math (1) Points
operators.
They are:

Add

Subtract

Multiply

Divide

All of the above (*)

Incorrect. Refer to Section

7. Which of the following elements of the Alice animation should be tested before the animation is considered complete?

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

8. From your Alice lessons, if you examined a science process that had many steps, which of the following is a way that you could

1. Present the problem as an animation.


2. Further refine and define the tasks needed for each high level step.
3. Identify the high level steps for the science concept.
1. Identify the high level steps for the science concept.
2. Further refine and define the tasks needed for each high level step.
3. Present the problem as an animation. (*)
Present the problem as an animation.
1. Identify the detailed steps for the science concept.
2. Present the problem as an animation.

Incorrect. Refer to Section

9. Which of the following are examples of elements you would test in your Alice animation?

(Choose all correct answers)

Math expressions calculate as expected. (*)

Objects move with smooth timing. (*)

All of the procedures display in alphabetical order in the Procedures tab.

Event listeners trigger the correct responses. (*)

Incorrect. Refer to Section

10. A variable is a place in memory where data of a specific type can be stored for later retrieval and use by your program

True (*)

False

Which of the
following Mark for Review
programming (1) Points
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?
Incorrect. Refer to Section 2 Lesson 10.

Which of the following


12. WHILE control structures co
collides with the shark?

(*)
Incorrect. Refer to Section 2 Lesson 8.

In Alice, we use
13.
the While control statement to im

When you want


14.specific code to be executed only

Incorrect. Refer to Section 2 Lesson 14.

You have a Class


15.representing Cat. A cat can meow
Which of the
following Mark for Review
programming (1) Points
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?
(*)

Incorrect. Refer to Section 2 Lesson 10.

12. Which of the following WHILE control structures commands the fish to move forward repeatedly
a time, but stop if it collides with the shark?

(*)

Incorrect. Refer to Section 2 Lesson 8.

13. In Alice, we use the While control statement to implement the conditional loop. True or false?

True (*)

False

Correct

14. When you want specific code to be executed only if certain conditions are met, what type of Jav
would you use?
if (*)

boolean

array

while loop

Incorrect. Refer to Section 2 Lesson 14.

15. You have a Class representing Cat. A cat can meow, purr, catch mice, and so on. When you cre
what is it called?

A subprogram

A variable class

A subclass

An instance (*)

A submethod

Which of
the Mark for Review
following (1) Points
comparison
symbols
represents
equals?

!=

>

<

= = (*)

Incorrect. Refer to Section 3 Lesson 5.

2. From your Greenfoot lessons, when does an if-else


statement execute it's second code segment? Mark for Review
(1) Points

If a condition is true.

When a random number is less than 10.

After the first code segment is executed.

If a condition is false. (*)

When an instance is created.


Incorrect. Refer to Section 3 Lesson 5.

3. Which of the following comparison operators represents


"greater than or equal"? Mark for Review
(1) Points

!=

>= (*)

==

>

Correct

4. In Greenfoot, which of the following is the correct notation


for calling a method for an instance of a class? Mark for Review
(1) Points

Method-name.object-name(parameters);

object-name.method-name(parameters); (*)

Method-name.object-name;

class-name.method-name(parameters);

Incorrect. Refer to Section 3 Lesson 5.

5. 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
6. In
Greenfoot, Mark for Review
the (1) Points
instance
has a
source
code
editor.
True or
false?
True

False (*)

Correct

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

True

False (*)

Correct

8. In Greenfoot, the move method expects what type of information in its


parameters? Mark for Review
(1) Points

True or false response

Degrees to turn

String statement

Integer of steps to move forward (*)

Correct

9. Which of the following are examples of default superclasses that are present in a
new Greenfoot scenario? Mark for Review
(1) Points

(Choose all correct answers)

Cat

Actor (*)

Dog

Parrot

World (*)

Incorrect. Refer to Section 3 Lesson 1.


10. In Greenfoot, a subclass is created by right-clicking on a superclass. True or
false? Mark for Review
(1) Points

True (*)

False

Correct
11. From
your Mark for Review
Greenfoot (1) Points
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. (*)

Correct

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

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

Inspector

Act method

Documentation (*)
If-statement

Correct

14. The list below provides actions you can perform in the Greenfoot code editor
except one. Which one should be removed? Mark for Review
(1) Points

Review the online Java Library documentation. (*)

Write and edit source code.

Write and edit comments.

Write source code to tell the class how to act in the scenario.

Incorrect. Refer to Section 3 Lesson 3.

15. Which of the following is an incorrectly written programming statement?


Mark for Review
(1) Points

turn(25);

turn(2);

move(2);

move(): (*)

Incorrect. Refer to Section 3 Lesson 4.


1. Alice provides pre-populated worlds through which new menu tab?
 Starters (*)
 Blank Slates
 File System - saved Alice projects can be opened and edited
 Recent

2. In Alice, which of the following programming statements moves the alien backward the distance to
the asteroid, minus 2 meters?
 this.Alien move backward {this.Alien getDistanceTo this.Asteroid -2} (*)
 this.Alien move backward {this.Alien getDistanceTo this.Asteroid * 2}
 this.Asteroid move backward {this.Alien getDistanceTo this.Asteorid / 2}
 this.Alien move forward {this.Asteroid getDistanceTo this.Alien / 2}

3. What is the first step to entering comments in an Alice program?


 Type comments that describe the sequence of actions in the code segment.
 Drag and drop the comments tile above a code segment. (*)
 Drag and drop the comments tile below a code segment.
 Select the instance from the instance menu.
4. Which of the following are examples of elements you would test in your Alice animation?
 All of the procedures display in alphabetical order in the Procedures tab.
 Math expressions calculate as expected. (*)
 Objects move with smooth timing. (*)
 Event listeners trigger the correct responses. (*)
 Comments were added below each sequence of instructions in the code.

5. You want an event to happen when an object collides with another object, which category of
event handler would you choose?
 Mouse
 Keyboard
 Scene Activation/time
 Position/Orientation (*)

6. Main is an example of what in the following code?


public static void main (String[] args) {
System.out.println{"Hello World!");
}
 A method (*)
 A class
 A variable

7. Which of the following does not describe methods?


 A subprogram that acts on data and often returns a value.
 A set of code that is referred to by name.
 Can be called at any point in a program simply by utilizing its name.
 Is associated with an instance variable. (*)

8. Which of the following is not an Alice variable value type?


 Color
 Decimal Number
 Whole Number
 Function (*)

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


 for
 end (*)
 while
 begin (*)

10. In Alice, if only objects that walk on four legs need to use a procedure, in which superclass would
the procedure be declared? When a new procedure is declared, all subclasses of the superclass will
inherit the procedure.
 Quadruped (*)
 Biped
 Swimmer
 Prop
11. In Alice, which of the following is not a control statement?
 Do In Order
 While
 Count
 Move (*)
 Do Together

12. 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 "=" operator. - True

13. Which of the following is an incorrectly written programming statement?


 move(): (*)
 move(2);
 turn(25);

The initial scene is the first scene of an animation where you select the background template and
position the objects.

In programming terms, a class is a blueprint used to build an object, and an object is an instance of a
class. After an object is added to a scene, it is referred to as an instance of the object. You can add
many instances of the same object to a scene (multiple coral objects in the water, for example). Each
instance must have a unique name.

A class contains the instructions that define the appearance and movement of an object. All objects
within a class have common properties. The class provides instructions to Alice 3 for creating and
displaying the object when it is added to your scene.

A procedure is a piece of program code that defines how the object should execute a task. Alice 3 has
a set of procedures for each class; however, users can create or "declare" new procedures.

An argument is a value that is used by the method to perform an action.

Argument types may include: – Direction – Amount – Duration – Text • Alice 3 recognizes how many
arguments are needed for each programming instruction. It presents you with the correct number of
cascading menus to specify the values for each of those arguments.

All Alice 3 objects share the same positioning features: – 3D coordinates on x, y, and z axes. – A
center point, where its own axes intersect (usually at the center of mass). – Sub-parts that can move.

A procedure is a set of instructions, or programmed code, for how the object should perform a task.
One-shot procedures are available in the Scene editor. They are the same as the procedures in the
Code editor; however, they only execute one time to re- position the object, unlike in the Code editor
where they will execute every time the Run button is clicked to play the animation.

• The Methods Panel contains two tabs: – Procedures: All pre-defined procedures for an object. –
Functions: All pre-defined functions for an object.
A procedure is a piece of program code that defines how the object should execute a task. Alice 3 has
a set of procedures for each class; however, users can create ("declare") new procedures.

A Function computes and answers a question about an object, such as, "What is its width or
height?", or "What is its distance from another object?" Alice 3 has a set of functions for each class;
however, users can declare new functions.

Alice creates a Do In Order control statement in the myFirstMethod procedure.

• Object movement is egocentric: – Objects move based on the direction they face. • An object can
move in six directions: – Up – Down – Forward – Backward – Right – Left

Move Moves the object in any one of its six directions. Move Toward Moves the object toward
another object. Move Away From Moves the object away from another object. Move To Moves the
object from its current position to the center point of the target object.
Move and Orient To
Moves the object from its current position to the center point of the target object and adjusts the
object's orientation to match the orientation of the target object.
Delay
Halts an object's movement for a certain number of seconds. Delay can be used to slow down the
execution of an animation. Say Creates a call-out bubble with text that makes the object appear to
talk.
Turn
Rotates an object left, right, forward, or backward on its center point. Left and right turn on the
object's vertical axis; forward and backward turn on the object's horizontal axis. Roll Rolls an object
left or right on its center point using the object's horizontal axis.

Argument types may include: – Object – Direction – Direction amount – Time duration – Text
An argument is a value that the procedure uses to complete its task. A computer program uses
arguments to tell it how to implement the procedure.

Arguments as Placeholders
• When a procedure is dropped into the Code editor, all argument values must be specified. • There
will be times that you select an argument value as a temporary placeholder value that will be
replaced later. • For example, you may want an object to move forward but you are not sure how far.
• Select a placeholder value of 2 meters, run the animation, determine that a different value is
needed, and then edit the value. • You can also specify a placeholder value that you will replace
later with a function or a variable.

Program Development Using a Top-Down Approach • Just as a homebuilder uses a set of blueprints
and follows a series of steps, a programmer uses a plan and follows a series of steps to build a
program. • Homebuilders work with a purpose and set specific goals as they build—the rooms are
energy efficient, the home meets building codes, etc. • Programmer's also work with a purpose and
set goals, because without them, success cannot be measured. • Another term for the goal or
purpose of an animation is a high-level scenario—a story with a purpose
Procedure Description
Do in order Execute the statements contained within the control statement in sequential order.
Do together Execute the statements contained within the control statement simultaneously.
Count Execute the statements contained within the control statement a specific number of times.
While Execute the statements contained within the control statement while a specified condition is
true.

Steps to Use Random Numbers


• For any numerical argument, one of the options is a random number. Select the argument from
the drop-down list. • Select Random. • Select nextRandomRealNumberInRange. • Select the low and
high values. • Run the animation. Alice 3 will randomly generate a value within the selected range
when the statement is executed.

What is a Storyboard?
• A storyboard identifies the design specifications for the animation scenario: – How objects appear,
move, speak, interact, and so on. • Once a scenario is defined, you can begin to develop the
animation storyboard. • Two types of storyboards are used to plan an animation: – Visual: A series
of illustrated images that represent the main scenes of the animation. – Textual: A detailed, ordered
list of actions that each object performs in each scene of the animation.

setVehicle Procedure
• The setVehicle procedure employs the concept of a rider object and a vehicle object. • The rider
object is selected when the setVehicle procedure is used to specify the vehicle for the rider. • Then,
when the vehicle object is programmed to move, the rider object will automatically move with it. •
Examples: – Person rides a camel or horse. – Camera follows a helicopter to shoot the scene from
the helicopter's point of view.
Greenfoot

14. From your Greenfoot lessons, what can methods belong to?
 Galleries
 Classes (*)
 Scenarios
 Objects (*)

15. In Greenfoot, the turn method expects what type of information in its parameters?
 Degrees to turn (*)
 True or false response
 String statement
 Integer of steps to move forward
 Parameter void

16. In Greenfoot, the move method expects what type of information in its parameters?
 Degrees to turn
 True or false response
 String statement
 Integer of steps to move forward (*)

17. In the Greenfoot IDE, an instance's position is on the x and y coordinates. True or false?
 True (*)

18. From your Greenfoot lessons, what are the ways that you can view a class's methods?
 In the scenario
 In the class's documentation (*)
 By right-clicking on an instance (*)
 In the Greenfoot gallery

19. Which class holds the method that ends a Greenfoot game?
 Greenfoot (*)
 Class
 GreenfootImage
 Actor

20. In the following Greenfoot array, what statement would you write to access the "a" key?
Keynames = {"a", "b", "c", "d"};
 keynames[2]
 keynames["a"]
 keynames[0] (*)
 keynames["a" key]

21. In Greenfoot, what is a common letter used for the loop variable?
 A
 I (*)
 X
 Y
22. In Greenfoot you can interact with the scenario using a mouse.
 True (*)
 False

23. Which of the following demonstrates a Greenfoot subclass/superclass relationship?


 A dog is a subclass of the cat superclass.
 A rose is a subclass of the flower superclass. (*)
 A computer is a subclass of a video game superclass.
 A single person is a superclass of the human subclass.

24. To execute a method in your Greenfoot game, where is it called from?


 The world
 The act method (*)
 The actor class
 The gallery
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.

Image files from 1-119 are associated with image1.

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

Incorrect. Refer to Section 3 Lesson 8.


In the
Greenfoot Mark for Review
IDE, (1) Points
what
does the
AND
operator
(&&) do?

Compares two boolean variables or expressions and returns a result that is true if either of its
operands are true.
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 either one of the
operands is true.
Compares two boolean values, and returns a boolean value which is true if and only if one of its
operands are true.

Incorrect. Refer to Section 3 Lesson 10.


In
Greenfoot, Mark for Review
what is a (1) Points
common
letter
used for
the loop
variable?

y
i (*)
x
a

Incorrect. Refer to Section 3 Lesson 10.

Das könnte Ihnen auch gefallen