Professional Documents
Culture Documents
Kunci Jawaban Kuis Java1
Kunci Jawaban Kuis Java1
In an
Alice Mark for Review
program, (1) Points
which
code is
executed
when
the Run
button is
clicked?
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 (*)
Count
While
Move (*)
Do In Order
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 (*)
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 (*)
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 (*)
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
True
False (*)
Incor
12. From your Alice lessons, which programming instruction represents the following movement: A turtle moves forwar
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
Image
Class
Direction (*)
Procedure (*)
Amount (*)
1. Which of
the Mark for Review
following (1) Points
is not a
relational
operator?
<
>
// (*)
=
Correct
i (*)
n (*)
args (*)
t (*)
Correct
Starters (*)
File System
Blank Slates
Recent
Correct
Scene Activation/Time
Cursor (*)
Keyboard
Position/Orientation
Mouse
Add
Subtract
Multiply
Divide
7. Which of the following elements of the Alice animation should be tested before the animation is considered complete?
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
9. Which of the following are examples of elements you would test in your Alice animation?
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.
(*)
Incorrect. Refer to Section 2 Lesson 8.
In Alice, we use
13.
the While control statement to im
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?
(*)
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
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?
!=
>
<
= = (*)
If a condition is true.
!=
>= (*)
==
>
Correct
Method-name.object-name(parameters);
object-name.method-name(parameters); (*)
Method-name.object-name;
class-name.method-name(parameters);
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
Degrees to turn
String statement
Correct
9. Which of the following are examples of default superclasses that are present in a
new Greenfoot scenario? Mark for Review
(1) Points
Cat
Actor (*)
Dog
Parrot
World (*)
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.
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
Write source code to tell the class how to act in the scenario.
turn(25);
turn(2);
move(2);
move(): (*)
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}
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 (*)
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
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.
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.
• 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.
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
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. (*)
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.
y
i (*)
x
a