0% found this document useful (0 votes)
442 views

Soal Greenfoot PDF

This document contains a 15 question quiz about concepts from Greenfoot lessons. It covers topics like methods that return the world, components of the source code editor, who to test games with, subclasses inheriting from superclasses, what the act method does, and more. Students are asked multiple choice questions to test their understanding of core Greenfoot concepts taught across several lessons.

Uploaded by

Derisma Derisma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
442 views

Soal Greenfoot PDF

This document contains a 15 question quiz about concepts from Greenfoot lessons. It covers topics like methods that return the world, components of the source code editor, who to test games with, subclasses inheriting from superclasses, what the act method does, and more. Students are asked multiple choice questions to test their understanding of core Greenfoot concepts taught across several lessons.

Uploaded by

Derisma Derisma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Section 3 Quiz 1 - L1-L5

(Answer all questions in this section)

1.In Greenfoot, which of the following methods return the world that
Mark for Review
the instance lives in?
(1) Points

getRotation()
World getClass()
World getWorld() (*)
getXY()

Correct

2.The list below displays components of the Greenfoot source code


Mark for Review
editor except one. Which one should be removed?
(1) Points

Method body
Comments
Instance creator (*)
Documentation
Class description

Incorrect. Refer to Section 3 Lesson 3.

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

Testing
Primary
Programmer
Target (*)

Incorrect. Refer to Section 3 Lesson 4.

4.In Greenfoot, a subclass is created by right-clicking on a superclass.


Mark for Review
True or false?
(1) Points

True (*)
False
Correct

5.In Greenfoot, a subclass is a specialization of a superclass. True or


Mark for Review
false?
(1) Points

True (*)
False

Correct

Section 3 Quiz 1 - L1-L5


(Answer all questions in this section)

6. In Greenfoot, the Run button repeatedly executes all of the


Mark for Review
programming statements in the class's act method in sequential order
(1) Points
until the pause button is clicked. True or false?

True (*)
False

Correct

7. From your Greenfoot lessons, an instance inherits all of the


Mark for Review
characteristics of the class, and those characteristics cannot be
(1) Points
changed. True or false?

True
False (*)

Incorrect. Refer to Section 3 Lesson 1.

8. In Greenfoot, methods can be called in the act method. When the Act
Mark for Review
button is clicked in the environment, the methods in the method body
(1) Points
of the act method are executed. True or false?

True (*)
False

Correct

9. An instance variable can be saved and accessed later, even if the


Mark for Review
instance no longer exists. True or false?
(1) Points
True
False (*)

Correct

10.In Greenfoot, the body of the method is located in between which of


Mark for Review
the following characters?
(1) Points

Parnetheses ( )
Curly brackets { } (*)
Square brackets [ ]
Asterisks **

Incorrect. Refer to Section 3 Lesson 2.

Section 3 Quiz 1 - L1-L5


(Answer all questions in this section)

11.In Greenfoot, the turn method expects what type of information in its
Mark for Review
parameters?
(1) Points

True or false response


String statement
Degrees to turn (*)
Parameter void
Integer of steps to move forward

Correct

12.Which of the following comparison symbols represents equals?


Mark for Review
(1) Points

= = (*)
<
!=
>

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

True
False (*)

Correct

14.From your Greenfoot lessons, what can methods belong to?


Mark for Review
(1) Points

(Choose all correct answers)

Galleries
Classes (*)
Scenarios
Objects (*)
All of the above

Incorrect. Refer to Section 3 Lesson 5.

15.What does the following Greenfoot programming statement tell the


Mark for Review
class to do?
(1) Points
if (Greenfoot.getRandomNumber(100) < 6) { turn(18); }

If a random number is returned that is greater than 6, turn 18


degrees.
If a random number is returned that is less than 6, move 18 steps.
If a random number is returned that is less than 6, turn 18
degrees. (*)
Turn 6 degrees, then turn 18 degrees.

Incorrect. Refer to Section 3 Lesson 5.

Section 3 Quiz 2 - L6-L10


(Answer all questions in this section)

1.In Greenfoot what command would you use to detect if a mouse has
Mark for Review
been clicked on an actor?
(1) Points

Greenfoot.clicked(this)
Actor.clicked(this)
Greenfoot.mouseClicked(this) (*)
Greenfoot.pressed(this)

Correct

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

True (*)
False

Correct

3.Greenfoot has tools to record sound. True or false?


Mark for Review
(1) Points

True (*)
False

Correct

4.Which actor method is used to detect a simple collision?


Mark for Review
(1) Points

isTouching() (*)
hasCollided()
hasTouched()
isCollision()
isInContactWith()

Correct

5.Defined methods are methods that are only created by the Greenfoot
Mark for Review
development team?
(1) Points

True
False (*)

Correct
Section 3 Quiz 2 - L6-L10
(Answer all questions in this section)

6. In reference to Greenfoot, if the following method was defined in a


Mark for Review
superclass,
(1) Points
public void turnAtEdge(){
...
}
all subclasses of the superclass will inherit the method.
True or false?

True (*)
False

Incorrect. Refer to Section 3 Lesson 6.

7. In Java what is casting?


Mark for Review
(1) Points

Casting is not possible in Java.


When you reset an object instance.
When you take an Object of one particular type and turn it into
another Object type. (*)
When you remove an object instance.

Correct

8. Use your Greenfoot knowldege: If an Actor class Fly has a variable


Mark for Review
defined to store the current speed, which of the following statements
(1) Points
would successfully add a Fly and define the current speed as 2?

addObject (new Fly(), 2, 150, 150);


addObject (new Fly(2), 150, 150); (*)
addObject (new Fly(2, 90), 150, 150);
addObject (new Fly(), 150, 150);

Correct

9. In Greenfoot modifying an actors constructor to accept an initial


Mark for Review
speed is a form of abstraction?
(1) Points
True (*)
False

Correct

10.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?

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

Correct

Section 3 Quiz 2 - L6-L10


(Answer all questions in this section)

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

True (*)
False

Correct

12.In Greenfoot, which method is used to end a game?


Mark for Review
(1) Points

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

Correct

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


Mark for Review
(1) Points
The condition becomes false after one minute of executions.
The code stops after 20 executions.
The code stops after 10 executions.
The code executes and does not stop. (*)

Correct

14.In Greenfoot, a local variable is declared at the beginning of a class.


Mark for Review
True or false?
(1) Points

True
False (*)

Incorrect. Refer to Section 3 Lesson 10.

15.In the following Greenfoot array, what statement would you write to
Mark for Review
access the "a" key?
(1) Points
Keynames = {"a", "b", "c", "d"};

keynames["a"]
keynames[0] (*)
keynames[2]
keynames["a" key]

Incorrect. Refer to Section 3 Lesson 10.

Section 3 Quiz 1 - L1-L5


(Answer all questions in this section)

1.Which of the following features of Greenfoot will locate syntax errors


Mark for Review
in your program?
(1) Points

Documentation
Code editor
Compilation (*)
Instance creation

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

True (*)
False

Correct

3.In Greenfoot, which of the following options are not possible when
Mark for Review
associating an image file with an instance?
(1) Points

Import an image
Select an image from the Greenfoot library
Add a video (*)
Draw an image

Correct

4.In Greenfoot, the body of the method is located in between which of


Mark for Review
the following characters?
(1) Points

Parnetheses ( )
Curly brackets { } (*)
Asterisks **
Square brackets [ ]

Correct

5.A variable is also known as a ____________.


Mark for Review
(1) Points

Syntax
Instance
Class
Field (*)
Method

Incorrect. Refer to Section 3 Lesson 2.


Section 3 Quiz 1 - L1-L5
(Answer all questions in this section)

6. From your Greenfoot lessons, what are the ways that you can view a
Mark for Review
class's methods?
(1) Points

(Choose all correct answers)

By right-clicking on an instance (*)


In the class's documentation (*)
In the Greenfoot gallery
In the scenario

Correct

7. The list below displays components of the Greenfoot source code


Mark for Review
editor except one. Which one should be removed?
(1) Points

Method body
Instance creator (*)
Comments
Documentation
Class description

Correct

8. In Greenfoot, what happens to an instance when the Act button is


Mark for Review
clicked in the environment?
(1) Points

The instance executes all of the programming statements in their


class's act method repeatedly until the scenario is stopped.
The instance executes all of the programming statements in their
class's act method once. (*)
The instance executes all of the programming statements in their
class's act method two times until the scenario is stopped.
The class executes all of the programming statements in their
instance's act method two times until the scenario is stopped.
Only one instance moves until the pause button is clicked.

Incorrect. Refer to Section 3 Lesson 1.


9. From your Greenfoot lessons, the reset button resets the scenario
Mark for Review
back to its initial position. True or false?
(1) Points

True (*)
False

Correct

10.Which of the following demonstrates a Greenfoot


Mark for Review
subclass/superclass relationship?
(1) Points

A rose is a subclass of the flower superclass. (*)


A dog is a subclass of the cat superclass.
A computer is a subclass of a video game superclass.
A single person is a superclass of the human subclass.

Correct

Section 3 Quiz 1 - L1-L5


(Answer all questions in this section)

11.Which of the following are examples of default superclasses that are


Mark for Review
present in a new Greenfoot scenario?
(1) Points

(Choose all correct answers)

Cat
Parrot
World (*)
Dog
Actor (*)

Incorrect. Refer to Section 3 Lesson 1.

12.Which of the following comparison symbols represents equals?


Mark for Review
(1) Points

!=
<
>
= = (*)

Correct

13.When a Greenfoot code segment is executed in an if-statement, each


Mark for Review
line of code is executed in sequential order. True or false?
(1) Points

True (*)
False

Incorrect. Refer to Section 3 Lesson 5.

14.Which of the following comparison operators represents "greater


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

>
!=
==
>= (*)

Correct

15.In Greenfoot, a semicolon is not necessary at the end of a method


Mark for Review
that uses dot notation. True or false?
(1) Points

True
False (*)

Correct

You might also like