1. Which actor method is used to detect a simple collision? Mark for Review
(1) Points
isInContactWith()
isTouching() (*)
isCollision()
hasCollided()
hasTouched()
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
2. Defined methods are methods that are only created by the Greenfoot development team? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
3. To execute a method in your Greenfoot game, where is it called from? Mark for Review
(1) Points
The world
The actor class
The act method (*)
The gallery
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
4. Use your Greenfoot knowledge: An array object holds a single variable. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
5. If an end to a while loop is not established, what happens? Mark for Review
(1) Points
The code stops after 10 executions.
The condition becomes false after one minute of executions.
The code stops after 20 executions.
The code executes and does not stop. (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
6. In Greenfoot, what types of values cannot be stored in a local variable? Mark for Review
(1) Points
Class name
Integers
Objects
Method (*)
World name
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
7. In Greenfoot modifying an actors constructor to accept an initial speed is a form of abstraction? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
8. In Java what is casting? Mark for Review
(1) Points
Casting is not possible in Java.
When you reset an object instance.
When you remove an object instance.
When you take an Object of one particular type and turn it into another Object type. (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
9. 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 an instance
Adding a property to a Class
Initialising a variable
[Correct] Correct
10. In Greenfoot what command would you use to detect if a mouse has been clicked on an actor? Mark for Review
(1) Points
Greenfoot.clicked(this)
Actor.clicked(this)
Greenfoot.mouseClicked(this) (*)
Greenfoot.pressed(this)
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
11. In Greenfoot, which method checks if a key on the keyboard has been pressed? Mark for Review
(1) Points
keyClick method
isKeyDown method (*)
keyPress method
isKeyUp method
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
12. Greenfoot has tools to record sound. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
13. Which class holds the method that ends a Greenfoot game? Mark for Review
(1) Points
Greenfoot (*)
GreenfootImage
Class
Actor
[Correct] Correct
14. What does the following programming statement mean?
image1 = new GreenfootImage("duke12.png"); Mark for Review
(1) Points
The image file, duke12.png, is assigned to the variable image1. (*)
The variable, image1, cannot use the image file, duke12.png.
The image file, duke12.png, has just been drawn and imported into the scenario.
Image files from 1-119 are associated with image1.
[Correct] Correct
15. We can use the Actor constructor to automatically create Actor instances when the Greenfoot world is initialized. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
1. A subclass has what kind of relationship to a superclass? Mark for Review
(1) Points
"a-is"
"is-by"
"for-what"
"is-a" (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 1.
2. In Greenfoot, which of the following are execution controls? Mark for Review
(1) Points
(Choose all correct answers)
Act (*)
Speed (*)
Turn
Move
Run (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 1.
3. In Greenfoot, the Run button repeatedly executes all of the programming statements in the class's act method in sequential order until the pause button is clicked. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
4. In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario? Mark for Review
(1) Points
Compilation (*)
Creation of an instance
Creation of source code
Editing of source code
[Correct] Correct
5. In Greenfoot, the move method expects what type of information in its parameters? Mark for Review
(1) Points
Degrees to turn
Integer of steps to move forward (*)
String statement
True or false response
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
6. In Greenfoot, which of the following options are not possible when associating an image file with an instance? Mark for Review
(1) Points
Draw an image
Import an image
Add a video (*)
Select an image from the Greenfoot library
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
7. A variable is also known as a ____________. Mark for Review
(1) Points
Instance
Syntax
Field (*)
Class
Method
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
8. In Greenfoot, the body of the method is located in between which of the following characters? Mark for Review
(1) Points
Curly brackets { } (*)
Asterisks **
Square brackets [ ]
Parnetheses ( )
[Correct] Correct
9. From your Greenfoot lessons, Which of the following statements is most correct? Mark for Review
(1) Points
My program is complete when it runs and I've tested the code. (*)
My program is complete when I add music to it.
My program is complete when I add images to it.
My program is complete when it compiles.
[Correct] Correct
10. From your Greenfoot lessons, which of the following methods return the current rotation of the object? Mark for Review
(1) Points
World getWorld()
int getRotation() (*)
getXY()
World getClass()
[Incorrect] Incorrect. Refer to Section 3 Lesson 3.
11. 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 and edit comments.
Write source code to tell the class how to act in the scenario.
Review the online Java Library documentation. (*)
Write and edit source code.
[Incorrect] Incorrect. Refer to Section 3 Lesson 3.
12. Which keyword indicates that Greenfoot needs to create a new object? Mark for Review
(1) Points
addObject
newObject
newClass
new (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
13. From your Greenfoot lessons, which type of constructor can be used to automate creation of Actor instances? Mark for Review
(1) Points
Actor
Vector
World (*)
Animal
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
14. Which of the following comparison symbols represents equals? Mark for Review
(1) Points
<
= = (*)
! =
>
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
15. 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] Correct
1. Which actor method is used to detect a simple collision? Mark for Review
(1) Points
hasTouched()
hasCollided()
isTouching() (*)
isCollision()
isInContactWith()
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
2. In reference to Greenfoot, if the following method was defined in a superclass,
public void turnAtEdge(){
...
}
all subclasses of the superclass will inherit the method.
True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
3. Defined methods are methods that are only created by the Greenfoot development team? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
4. Which Greenfoot control operator is used to test if two values are equal? Mark for Review
(1) Points
!= operator
>= operator
== operator (*)
= operator
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
5. Greenfoot Actor instances get their images from which of the following? Mark for Review
(1) Points
Their class (*)
Their source code
Their methods
Their image editor
6. In Greenfoot, we typically use the act method in the class to automatically create the Actor instances when the world is initialized. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
7. From your Greenfoot lessons, what types of values cannot be stored in a local variable? Mark for Review
(1) Points
(Choose all correct answers)
method (*)
Class name
Objects
World name
Integers
[Correct] Correct
8. Which of the following is not a component of a while loop? Mark for Review
(1) Points
if statement (*)
Loop variable
while keyword
Control operator
Local variable
[Correct] Correct
9. In Greenfoot, when is a local variable most often used? Mark for Review
(1) Points
Within the world constructor
Within the act method
Within loop constructs (*)
Within the scenario
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
10. In Java what is casting? Mark for Review
(1) Points
When you reset an object instance.
Casting is not possible in Java.
When you take an Object of one particular type and turn it into another Object type. (*)
When you remove an object instance.
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
11. From your Greenfoot lessons, abstraction techniques can only be used once in a class's source code. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
12. In Greenfoot, you can cast an Actor class to a World class? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
13. In Greenfoot, you can only interact with the scenario using a keyboard. Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
14. In Greenfoot, which class has methods that allow you to get the status of the mouse? Mark for Review
(1) Points
Scenario
Greenfoot (*)
Actor
World
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
15. In Greenfoot when you use the method to retrieve input from the user, the scenario will continue to run in the background? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
1. In computing, a textual storyboard is called a source code: a list of actions to perform a task or solve a problem. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 2 Lesson 1.
2. In Alice, which of the following programming statements moves the cat backward, half the distance to the bird? Mark for Review
(1) Points
this.Cat move backward {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 / 2}
this.Cat move backward {this.Cat getDistanceTo this.Bird / 2} (*)
[Correct] Correct
3.
Expressions with relational operators produce true and false values. True or false?
Mark for Review
(1) Points
True (*)
False
[Correct] Correct
4. 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] Correct
5. In Alice, which of the following are benefits of separating out motions into their own procedures? Mark for Review
(1) Points
(Choose all correct answers)
It makes the animation easier to run.
It makes the scene easier to view.
It simplifies code and makes it easier to read. (*)
It allows many objects of a class to use the same procedure. (*)
It can allow subclasses of a superclass to use a procedure. (*)
[Correct] Correct
Section 2
6. In Alice, procedural abstraction is the concept of making code easier to understand and reuse. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
7. In Alice, when a new procedure is declared, all subclasses of the superclass will inherit the procedure. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
8. From your Alice lessons, variables are fixed and cannot be changed. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
9. From your Alice lessons, what can be used as a guideline to ensure your animation fulfills animation principles? Mark for Review
(1) Points
The Internet
Animation checklist (*)
A close friend
None of the above
[Correct] Correct
10. From your Alice lessons, number, boolean, String and object are all examples of variable types. True or false? Mark for Review
(1) Points
True (*)
False
[Incorrect] Incorrect. Refer to Section 2 Lesson 8.
Section 2
11. Which of the following is not an example of the logic of an IF control structure? Mark for Review
(1) Points
Play the video three times. (*)
If the play button is pressed, then play the video one time.
If the doorbell rings, then the door opens.
If the bird rings the bell, a treat is dispensed.
[Correct] Correct
12. Main is an example of what in the following code?
public static void main (String[] args) {
System.out.println{"Hello World!");
} Mark for Review
(1) Points
An instance
A method (*)
A class
A variable
[Incorrect] Incorrect. Refer to Section 2 Lesson 10.
13. A complete Alice instruction includes which of the following components? Mark for Review
(1) Points
(Choose all correct answers)
Image
Class
Procedure (*)
Direction (*)
Amount (*)
[Incorrect] Incorrect. Refer to Section 2 Lesson 3.
14. In Alice, which of the following instructions roll the Blue Tang fish left 1 meter? Mark for Review
(1) Points
this.blueTang roll Left 1.0 (*)
this.blueTang Left 1.0
this.blueTang Left 1
this.blueTang roll Left 1
[Correct] Correct
15. From your Alice lessons, random numbers are set in the distance and duration arguments in a procedure. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
Section 2
16. From your Alice lessons, what is a one-shot procedural method? Mark for Review
(1) Points
A procedure that is invoked when the Run button is clicked.
A procedure that is used to make a scene adjustment. (*)
A procedure that is dragged into the code editor.
A procedure that is used to launch the program.
[Correct] Correct
17. From your Alice lessons, an instance's properties cannot be modified. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 2 Lesson 2.
18. From your Alice lessons, saving multiple versions of an Alice animation scene is unimportant, because it does not save time. It actually wastes time. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
19. What Alice tool can be used to diagram the If conditional execution statement? Mark for Review
(1) Points
Cause and effect diagram
Process flow diagram (*)
Conditional flow diagram
[Incorrect] Incorrect. Refer to Section 2 Lesson 6.
20. From your Alice lessons, the If control structure can process one true and one false response. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
Section 2
21. The Alice If control structure requires the false statement to be populated. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
22. In Alice, which of the following arguments are available to further refine an object's movements? Mark for Review
(1) Points
(Choose all correct answers)
Object
Distance (*)
Duration (*)
Delay
[Incorrect] Incorrect. Refer to Section 2 Lesson 5.
23. From your Alice lessons, where should comments be placed? Mark for Review
(1) Points
Above each set of programming statements. (*)
At the end of the program.
In the scene editor.
In their own procedure.
[Correct] Correct
24. In Alice, once procedures are added to a control statement, they cannot be changed. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
25. In Alice, functions are dragged into the control statement, not the procedure. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
Section 3
26. Which of the following demonstrates a Greenfoot subclass/superclass relationship? Mark for Review
(1) Points
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.
[Correct] Correct
27. In Greenfoot, which of the following are execution controls? Mark for Review
(1) Points
(Choose all correct answers)
Run (*)
Act (*)
Speed (*)
Move
Turn
[Correct] Correct
28. In a Greenfoot if-else statement, if the condition is true, the if-statement is executed, and then the else-statement is executed. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
29. From your Greenfoot lessons, which type of constructor can be used to automate creation of Actor instances? Mark for Review
(1) Points
Animal
World (*)
Actor
Vector
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
30. From your Greenfoot lessons, classes can only use the methods they have inherited. They cannot use methods from other classes. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
Test: Java Fundamentals Mid Term Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 3
31. From your Greenfoot lessons, how do you test that your code does not contain bugs? Mark for Review
(1) Points
Write the code.
Inspect the instances.
Review the documentation.
Compile the code. (*)
[Correct] Correct
32. From your Greenfoot lessons, which line of code is missing something?
Mark for Review
(1) Points
1
3 (*)
4
5
6
[Correct] Correct
33. In Greenfoot, you may perform the programming tasks of create and test many times. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
34. Greenfoot does not have tools to record sound. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
35. In Greenfoot, which method checks if a key on the keyboard has been pressed? Mark for Review
(1) Points
keyPress method
keyUp method
keyDown method (*)
keyClick method
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
Section 3
36. In Greenfoot, actor constructors can be used to create images or values and assign them to the variables. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
37. When you re-initialize a scenario, Greenfoot automatically displays an instance of the World subclass in the scenario. True or false? Mark for Review
(1) Points
True (*)
False
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
38. In Greenfoot, an if-statement is used to alternate between displaying two images in an instance. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
39. In Greenfoot, a local variable is declared at the beginning of a class. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
40. In Greenfoot, what is a common letter used for the loop variable? Mark for Review
(1) Points
A
I (*)
X
Y
[Correct] Correct
Section 3
41. In Greenfoot, which of the following statements could prevent an infinite loop from occurring? Mark for Review
(1) Points
I = 100 + i
i=1
i = i
i = i + 1 (*)
[Correct] Correct
42. Use your Greenfoot knowledge to answer the question. One reason to write a defined method in a class is to change the behavior of the class. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
43. To execute a method in your Greenfoot game, where is it called from? Mark for Review
(1) Points
The world
The act method (*)
The actor class
The gallery
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
44. In Greenfoot, defined methods must be used immediately. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
45. In the Greenfoot IDE, which of the following is not a property of an instance? Mark for Review
(1) Points
Position
Inherited methods
Scenario name (*)
Defined methods
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
Section 3
46. What does the following Greenfoot programming statement do?
turn(18); Mark for Review
(1) Points
Turn the object 36 degrees.
Turn the object 18 degrees. (*)
Turn the object 18 steps forward.
Move the object 18 steps forward.
[Correct] Correct
47. What type of Greenfoot method would be used to turn an object? Mark for Review
(1) Points
orientTo( );
turnAround( );
move ( );
turn( ); (*)
[Correct] Correct
48. From your Greenfoot lessons, abstraction techniques can only be used once in a class's source code. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
49. Use your Greenfoot knowldege: Abstraction occurs in many different ways in programming. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
50. In Greenfoot, what happens if the condition is false in an if-statement? Mark for Review
(1) Points
The programming statements are executed.
The if-statement is executed.
The act method is deleted.
The programming statements are not executed. (*)
[Correct] Correct
1. From your Greenfoot lessons, Which of the following statements is most correct?
My program is complete when I add music to it.
My program is complete when it runs and I've tested the code. (*)
My program is complete when I add images to it.
My program is complete when it compiles.
2. Which of the following Java syntax is used to correctly create a Bee subclass?
private class extends Bee
private Bee extends World
public class Bee extends World
private class extends Actor
public class Bee extends Animal (*)
3. What does an instance of the World class do? Mark for Review
(1) Points
Provide the superclass for acting objects.
Provide the source code for instances.
Provide the background scenery for the scenario. (*)
Provide the acting objects for the scenario.
4. In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario? Mark for Review
(1) Points
Creation of an instance
Creation of source code
Editing of source code
Compilation (*)
5. In Greenfoot, the class holds the general attributes of an instance, such as the methods it inherits. True or false? Mark for Review
(1) Points
True (*)
False
6. In Greenfoot, the body of the method is located in between which of the following characters? Mark for Review
(1) Points
Square brackets [ ]
Curly brackets { } (*)
Asterisks **
Parnetheses ( )
7. In Greenfoot, the move method expects what type of information in its parameters? Mark for Review
(1) Points
Degrees to turn
Integer of steps to move forward (*)
True or false response
String statement
8. A variable is also known as a ____________. Mark for Review
(1) Points
Instance
Syntax
Field (*)
Method
Class
9. Using the Greenfoot IDE, only five instances can be added to a scenario. True or false? Mark for Review
(1) Points
True
False (*)
10. 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.
After the first code segment is executed.
When an instance is created.
When a random number is less than 10.
If a condition is false. (*)
11. 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);
Method-name.object-name;
object-name.method-name(parameters); (*)
class-name.method-name(parameters);
12. Which of the following Greenfoot methods returns a random number between 0, up to and including 10,000? Mark for Review
(1) Points
Greenfoot.getRandomNumber(0-10,000)
Greenfoot.getRandomNumber(9,999)
Greenfoot.getRandomNumber(10,000)
Greenfoot.getRandomNumber(10,001) (*)
13. Read the following method signature. Using your Greenfoot experience, what does this method do?
public static int getRandomNumber (int limit) Mark for Review
(1) Points
Returns a random number between zero and the parameter limit. (*)
Returns a random number for instances in the animal class only.
Returns a random coordinate position in the world.
Returns a random number less than 10.
Correct Correct
14. From your Greenfoot lessons, where do you review a class's inherited methods? Mark for Review
(1) Points
Inspector
Act method
If-statement
Documentation (*)
15. The list below displays components of the Greenfoot source code editor except one. Which one should be removed? Mark for Review
(1) Points
Class description
Comments
Instance creator (*)
Documentation
Method body
1. In Greenfoot, only 10 methods can be written for each class in the Code editor. True or false? Mark for Review
(1) Points
True
False (*)
2. From your Greenfoot lessons, where do you review a class's inherited methods? Mark for Review
(1) Points
Act method
Inspector
Documentation (*)
If-statement
3. In Greenfoot, the turn method expects what type of information in its parameters? Mark for Review
(1) Points
Parameter void
True or false response
Integer of steps to move forward
Degrees to turn (*)
String statement
4. In Greenfoot, methods can be called in the act method. When the Act button is clicked in the environment, the methods in the method body of the act method are executed. True or false? Mark for Review
(1) Points
True (*)
False
5. Using the Greenfoot IDE, only five instances can be added to a scenario. True or false? Mark for Review
(1) Points
True
False (*)
6. In Greenfoot, the instance has a source code editor. True or false? Mark for Review
(1) Points
True
False (*)
7. In Greenfoot, the origin of the world coordinate system (0,0) starts in the center of the world. True or false? Mark for Review
(1) Points
True
False (*)
8. From your Greenfoot lessons, classes can only use the methods they have inherited. They cannot use methods from other classes. True or false? Mark for Review
(1) Points
True
False (*)
9. The list below displays characteristics of a Greenfoot world constructor, except for one. Which one should be removed? Mark for Review
(1) Points
Has no return type.
Has a void return type. (*)
Executed automatically when a new instance of the class is created.
Defines the instance's size and resolution.
Has the same name as the name of the class.
10. What does the following Greenfoot programming statement tell the class to do?
if (Greenfoot.getRandomNumber(100) < 6) { turn(18); } Mark for Review
(1) Points
Turn 6 degrees, then turn 18 degrees.
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, turn 18 degrees. (*)
If a random number is returned that is less than 6, move 18 steps.
11. In Greenfoot, you will not receive an error message if your code is incorrect. It will simply not work, and you will have to determine why the code doesn't work. True or false? Mark for Review
(1) Points
True
False (*)
12. In Greenfoot, what happens to an instance when the Act button is clicked in the environment? Mark for Review
(1) Points
The class executes all of the programming statements in their instance's act method two times 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 instance executes all of the programming statements in their class's act method repeatedly until the scenario is stopped.
Only one instance moves until the pause button is clicked.
13. In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario? Mark for Review
(1) Points
Creation of an instance
Editing of source code
Creation of source code
Compilation (*)
14. In Greenfoot, a subclass is created by right-clicking on a superclass. True or false? Mark for Review
(1) Points
True (*)
False
15. Which of the following Java syntax is used to correctly create a Bee subclass? Mark for Review
(1) Points
private class extends Actor
private Bee extends World
public class Bee extends World
public class Bee extends Animal (*)
private class extends Bee
(1) Points
isInContactWith()
isTouching() (*)
isCollision()
hasCollided()
hasTouched()
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
2. Defined methods are methods that are only created by the Greenfoot development team? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
3. To execute a method in your Greenfoot game, where is it called from? Mark for Review
(1) Points
The world
The actor class
The act method (*)
The gallery
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
4. Use your Greenfoot knowledge: An array object holds a single variable. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
5. If an end to a while loop is not established, what happens? Mark for Review
(1) Points
The code stops after 10 executions.
The condition becomes false after one minute of executions.
The code stops after 20 executions.
The code executes and does not stop. (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
6. In Greenfoot, what types of values cannot be stored in a local variable? Mark for Review
(1) Points
Class name
Integers
Objects
Method (*)
World name
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
7. In Greenfoot modifying an actors constructor to accept an initial speed is a form of abstraction? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
8. In Java what is casting? Mark for Review
(1) Points
Casting is not possible in Java.
When you reset an object instance.
When you remove an object instance.
When you take an Object of one particular type and turn it into another Object type. (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
9. 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 an instance
Adding a property to a Class
Initialising a variable
[Correct] Correct
10. In Greenfoot what command would you use to detect if a mouse has been clicked on an actor? Mark for Review
(1) Points
Greenfoot.clicked(this)
Actor.clicked(this)
Greenfoot.mouseClicked(this) (*)
Greenfoot.pressed(this)
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
11. In Greenfoot, which method checks if a key on the keyboard has been pressed? Mark for Review
(1) Points
keyClick method
isKeyDown method (*)
keyPress method
isKeyUp method
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
12. Greenfoot has tools to record sound. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
13. Which class holds the method that ends a Greenfoot game? Mark for Review
(1) Points
Greenfoot (*)
GreenfootImage
Class
Actor
[Correct] Correct
14. What does the following programming statement mean?
image1 = new GreenfootImage("duke12.png"); Mark for Review
(1) Points
The image file, duke12.png, is assigned to the variable image1. (*)
The variable, image1, cannot use the image file, duke12.png.
The image file, duke12.png, has just been drawn and imported into the scenario.
Image files from 1-119 are associated with image1.
[Correct] Correct
15. We can use the Actor constructor to automatically create Actor instances when the Greenfoot world is initialized. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
1. A subclass has what kind of relationship to a superclass? Mark for Review
(1) Points
"a-is"
"is-by"
"for-what"
"is-a" (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 1.
2. In Greenfoot, which of the following are execution controls? Mark for Review
(1) Points
(Choose all correct answers)
Act (*)
Speed (*)
Turn
Move
Run (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 1.
3. In Greenfoot, the Run button repeatedly executes all of the programming statements in the class's act method in sequential order until the pause button is clicked. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
4. In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario? Mark for Review
(1) Points
Compilation (*)
Creation of an instance
Creation of source code
Editing of source code
[Correct] Correct
5. In Greenfoot, the move method expects what type of information in its parameters? Mark for Review
(1) Points
Degrees to turn
Integer of steps to move forward (*)
String statement
True or false response
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
6. In Greenfoot, which of the following options are not possible when associating an image file with an instance? Mark for Review
(1) Points
Draw an image
Import an image
Add a video (*)
Select an image from the Greenfoot library
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
7. A variable is also known as a ____________. Mark for Review
(1) Points
Instance
Syntax
Field (*)
Class
Method
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
8. In Greenfoot, the body of the method is located in between which of the following characters? Mark for Review
(1) Points
Curly brackets { } (*)
Asterisks **
Square brackets [ ]
Parnetheses ( )
[Correct] Correct
9. From your Greenfoot lessons, Which of the following statements is most correct? Mark for Review
(1) Points
My program is complete when it runs and I've tested the code. (*)
My program is complete when I add music to it.
My program is complete when I add images to it.
My program is complete when it compiles.
[Correct] Correct
10. From your Greenfoot lessons, which of the following methods return the current rotation of the object? Mark for Review
(1) Points
World getWorld()
int getRotation() (*)
getXY()
World getClass()
[Incorrect] Incorrect. Refer to Section 3 Lesson 3.
11. 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 and edit comments.
Write source code to tell the class how to act in the scenario.
Review the online Java Library documentation. (*)
Write and edit source code.
[Incorrect] Incorrect. Refer to Section 3 Lesson 3.
12. Which keyword indicates that Greenfoot needs to create a new object? Mark for Review
(1) Points
addObject
newObject
newClass
new (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
13. From your Greenfoot lessons, which type of constructor can be used to automate creation of Actor instances? Mark for Review
(1) Points
Actor
Vector
World (*)
Animal
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
14. Which of the following comparison symbols represents equals? Mark for Review
(1) Points
<
= = (*)
! =
>
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
15. 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] Correct
1. Which actor method is used to detect a simple collision? Mark for Review
(1) Points
hasTouched()
hasCollided()
isTouching() (*)
isCollision()
isInContactWith()
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
2. In reference to Greenfoot, if the following method was defined in a superclass,
public void turnAtEdge(){
...
}
all subclasses of the superclass will inherit the method.
True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
3. Defined methods are methods that are only created by the Greenfoot development team? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
4. Which Greenfoot control operator is used to test if two values are equal? Mark for Review
(1) Points
!= operator
>= operator
== operator (*)
= operator
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
5. Greenfoot Actor instances get their images from which of the following? Mark for Review
(1) Points
Their class (*)
Their source code
Their methods
Their image editor
6. In Greenfoot, we typically use the act method in the class to automatically create the Actor instances when the world is initialized. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
7. From your Greenfoot lessons, what types of values cannot be stored in a local variable? Mark for Review
(1) Points
(Choose all correct answers)
method (*)
Class name
Objects
World name
Integers
[Correct] Correct
8. Which of the following is not a component of a while loop? Mark for Review
(1) Points
if statement (*)
Loop variable
while keyword
Control operator
Local variable
[Correct] Correct
9. In Greenfoot, when is a local variable most often used? Mark for Review
(1) Points
Within the world constructor
Within the act method
Within loop constructs (*)
Within the scenario
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
10. In Java what is casting? Mark for Review
(1) Points
When you reset an object instance.
Casting is not possible in Java.
When you take an Object of one particular type and turn it into another Object type. (*)
When you remove an object instance.
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
11. From your Greenfoot lessons, abstraction techniques can only be used once in a class's source code. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
12. In Greenfoot, you can cast an Actor class to a World class? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
13. In Greenfoot, you can only interact with the scenario using a keyboard. Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
14. In Greenfoot, which class has methods that allow you to get the status of the mouse? Mark for Review
(1) Points
Scenario
Greenfoot (*)
Actor
World
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
15. In Greenfoot when you use the method to retrieve input from the user, the scenario will continue to run in the background? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
1. In computing, a textual storyboard is called a source code: a list of actions to perform a task or solve a problem. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 2 Lesson 1.
2. In Alice, which of the following programming statements moves the cat backward, half the distance to the bird? Mark for Review
(1) Points
this.Cat move backward {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 / 2}
this.Cat move backward {this.Cat getDistanceTo this.Bird / 2} (*)
[Correct] Correct
3.
Expressions with relational operators produce true and false values. True or false?
Mark for Review
(1) Points
True (*)
False
[Correct] Correct
4. 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] Correct
5. In Alice, which of the following are benefits of separating out motions into their own procedures? Mark for Review
(1) Points
(Choose all correct answers)
It makes the animation easier to run.
It makes the scene easier to view.
It simplifies code and makes it easier to read. (*)
It allows many objects of a class to use the same procedure. (*)
It can allow subclasses of a superclass to use a procedure. (*)
[Correct] Correct
Section 2
6. In Alice, procedural abstraction is the concept of making code easier to understand and reuse. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
7. In Alice, when a new procedure is declared, all subclasses of the superclass will inherit the procedure. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
8. From your Alice lessons, variables are fixed and cannot be changed. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
9. From your Alice lessons, what can be used as a guideline to ensure your animation fulfills animation principles? Mark for Review
(1) Points
The Internet
Animation checklist (*)
A close friend
None of the above
[Correct] Correct
10. From your Alice lessons, number, boolean, String and object are all examples of variable types. True or false? Mark for Review
(1) Points
True (*)
False
[Incorrect] Incorrect. Refer to Section 2 Lesson 8.
Section 2
11. Which of the following is not an example of the logic of an IF control structure? Mark for Review
(1) Points
Play the video three times. (*)
If the play button is pressed, then play the video one time.
If the doorbell rings, then the door opens.
If the bird rings the bell, a treat is dispensed.
[Correct] Correct
12. Main is an example of what in the following code?
public static void main (String[] args) {
System.out.println{"Hello World!");
} Mark for Review
(1) Points
An instance
A method (*)
A class
A variable
[Incorrect] Incorrect. Refer to Section 2 Lesson 10.
13. A complete Alice instruction includes which of the following components? Mark for Review
(1) Points
(Choose all correct answers)
Image
Class
Procedure (*)
Direction (*)
Amount (*)
[Incorrect] Incorrect. Refer to Section 2 Lesson 3.
14. In Alice, which of the following instructions roll the Blue Tang fish left 1 meter? Mark for Review
(1) Points
this.blueTang roll Left 1.0 (*)
this.blueTang Left 1.0
this.blueTang Left 1
this.blueTang roll Left 1
[Correct] Correct
15. From your Alice lessons, random numbers are set in the distance and duration arguments in a procedure. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
Section 2
16. From your Alice lessons, what is a one-shot procedural method? Mark for Review
(1) Points
A procedure that is invoked when the Run button is clicked.
A procedure that is used to make a scene adjustment. (*)
A procedure that is dragged into the code editor.
A procedure that is used to launch the program.
[Correct] Correct
17. From your Alice lessons, an instance's properties cannot be modified. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 2 Lesson 2.
18. From your Alice lessons, saving multiple versions of an Alice animation scene is unimportant, because it does not save time. It actually wastes time. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
19. What Alice tool can be used to diagram the If conditional execution statement? Mark for Review
(1) Points
Cause and effect diagram
Process flow diagram (*)
Conditional flow diagram
[Incorrect] Incorrect. Refer to Section 2 Lesson 6.
20. From your Alice lessons, the If control structure can process one true and one false response. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
Section 2
21. The Alice If control structure requires the false statement to be populated. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
22. In Alice, which of the following arguments are available to further refine an object's movements? Mark for Review
(1) Points
(Choose all correct answers)
Object
Distance (*)
Duration (*)
Delay
[Incorrect] Incorrect. Refer to Section 2 Lesson 5.
23. From your Alice lessons, where should comments be placed? Mark for Review
(1) Points
Above each set of programming statements. (*)
At the end of the program.
In the scene editor.
In their own procedure.
[Correct] Correct
24. In Alice, once procedures are added to a control statement, they cannot be changed. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
25. In Alice, functions are dragged into the control statement, not the procedure. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
Section 3
26. Which of the following demonstrates a Greenfoot subclass/superclass relationship? Mark for Review
(1) Points
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.
[Correct] Correct
27. In Greenfoot, which of the following are execution controls? Mark for Review
(1) Points
(Choose all correct answers)
Run (*)
Act (*)
Speed (*)
Move
Turn
[Correct] Correct
28. In a Greenfoot if-else statement, if the condition is true, the if-statement is executed, and then the else-statement is executed. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
29. From your Greenfoot lessons, which type of constructor can be used to automate creation of Actor instances? Mark for Review
(1) Points
Animal
World (*)
Actor
Vector
[Incorrect] Incorrect. Refer to Section 3 Lesson 5.
30. From your Greenfoot lessons, classes can only use the methods they have inherited. They cannot use methods from other classes. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
Test: Java Fundamentals Mid Term Exam
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 3
31. From your Greenfoot lessons, how do you test that your code does not contain bugs? Mark for Review
(1) Points
Write the code.
Inspect the instances.
Review the documentation.
Compile the code. (*)
[Correct] Correct
32. From your Greenfoot lessons, which line of code is missing something?
Mark for Review
(1) Points
1
3 (*)
4
5
6
[Correct] Correct
33. In Greenfoot, you may perform the programming tasks of create and test many times. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
34. Greenfoot does not have tools to record sound. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
35. In Greenfoot, which method checks if a key on the keyboard has been pressed? Mark for Review
(1) Points
keyPress method
keyUp method
keyDown method (*)
keyClick method
[Incorrect] Incorrect. Refer to Section 3 Lesson 7.
Section 3
36. In Greenfoot, actor constructors can be used to create images or values and assign them to the variables. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
37. When you re-initialize a scenario, Greenfoot automatically displays an instance of the World subclass in the scenario. True or false? Mark for Review
(1) Points
True (*)
False
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
38. In Greenfoot, an if-statement is used to alternate between displaying two images in an instance. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 8.
39. In Greenfoot, a local variable is declared at the beginning of a class. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 10.
40. In Greenfoot, what is a common letter used for the loop variable? Mark for Review
(1) Points
A
I (*)
X
Y
[Correct] Correct
Section 3
41. In Greenfoot, which of the following statements could prevent an infinite loop from occurring? Mark for Review
(1) Points
I = 100 + i
i=1
i = i
i = i + 1 (*)
[Correct] Correct
42. Use your Greenfoot knowledge to answer the question. One reason to write a defined method in a class is to change the behavior of the class. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
43. To execute a method in your Greenfoot game, where is it called from? Mark for Review
(1) Points
The world
The act method (*)
The actor class
The gallery
[Incorrect] Incorrect. Refer to Section 3 Lesson 6.
44. In Greenfoot, defined methods must be used immediately. True or false? Mark for Review
(1) Points
True
False (*)
[Correct] Correct
45. In the Greenfoot IDE, which of the following is not a property of an instance? Mark for Review
(1) Points
Position
Inherited methods
Scenario name (*)
Defined methods
[Incorrect] Incorrect. Refer to Section 3 Lesson 2.
Section 3
46. What does the following Greenfoot programming statement do?
turn(18); Mark for Review
(1) Points
Turn the object 36 degrees.
Turn the object 18 degrees. (*)
Turn the object 18 steps forward.
Move the object 18 steps forward.
[Correct] Correct
47. What type of Greenfoot method would be used to turn an object? Mark for Review
(1) Points
orientTo( );
turnAround( );
move ( );
turn( ); (*)
[Correct] Correct
48. From your Greenfoot lessons, abstraction techniques can only be used once in a class's source code. True or false? Mark for Review
(1) Points
True
False (*)
[Incorrect] Incorrect. Refer to Section 3 Lesson 9.
49. Use your Greenfoot knowldege: Abstraction occurs in many different ways in programming. True or false? Mark for Review
(1) Points
True (*)
False
[Correct] Correct
50. In Greenfoot, what happens if the condition is false in an if-statement? Mark for Review
(1) Points
The programming statements are executed.
The if-statement is executed.
The act method is deleted.
The programming statements are not executed. (*)
[Correct] Correct
1. From your Greenfoot lessons, Which of the following statements is most correct?
My program is complete when I add music to it.
My program is complete when it runs and I've tested the code. (*)
My program is complete when I add images to it.
My program is complete when it compiles.
2. Which of the following Java syntax is used to correctly create a Bee subclass?
private class extends Bee
private Bee extends World
public class Bee extends World
private class extends Actor
public class Bee extends Animal (*)
3. What does an instance of the World class do? Mark for Review
(1) Points
Provide the superclass for acting objects.
Provide the source code for instances.
Provide the background scenery for the scenario. (*)
Provide the acting objects for the scenario.
4. In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario? Mark for Review
(1) Points
Creation of an instance
Creation of source code
Editing of source code
Compilation (*)
5. In Greenfoot, the class holds the general attributes of an instance, such as the methods it inherits. True or false? Mark for Review
(1) Points
True (*)
False
6. In Greenfoot, the body of the method is located in between which of the following characters? Mark for Review
(1) Points
Square brackets [ ]
Curly brackets { } (*)
Asterisks **
Parnetheses ( )
7. In Greenfoot, the move method expects what type of information in its parameters? Mark for Review
(1) Points
Degrees to turn
Integer of steps to move forward (*)
True or false response
String statement
8. A variable is also known as a ____________. Mark for Review
(1) Points
Instance
Syntax
Field (*)
Method
Class
9. Using the Greenfoot IDE, only five instances can be added to a scenario. True or false? Mark for Review
(1) Points
True
False (*)
10. 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.
After the first code segment is executed.
When an instance is created.
When a random number is less than 10.
If a condition is false. (*)
11. 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);
Method-name.object-name;
object-name.method-name(parameters); (*)
class-name.method-name(parameters);
12. Which of the following Greenfoot methods returns a random number between 0, up to and including 10,000? Mark for Review
(1) Points
Greenfoot.getRandomNumber(0-10,000)
Greenfoot.getRandomNumber(9,999)
Greenfoot.getRandomNumber(10,000)
Greenfoot.getRandomNumber(10,001) (*)
13. Read the following method signature. Using your Greenfoot experience, what does this method do?
public static int getRandomNumber (int limit) Mark for Review
(1) Points
Returns a random number between zero and the parameter limit. (*)
Returns a random number for instances in the animal class only.
Returns a random coordinate position in the world.
Returns a random number less than 10.
Correct Correct
14. From your Greenfoot lessons, where do you review a class's inherited methods? Mark for Review
(1) Points
Inspector
Act method
If-statement
Documentation (*)
15. The list below displays components of the Greenfoot source code editor except one. Which one should be removed? Mark for Review
(1) Points
Class description
Comments
Instance creator (*)
Documentation
Method body
1. In Greenfoot, only 10 methods can be written for each class in the Code editor. True or false? Mark for Review
(1) Points
True
False (*)
2. From your Greenfoot lessons, where do you review a class's inherited methods? Mark for Review
(1) Points
Act method
Inspector
Documentation (*)
If-statement
3. In Greenfoot, the turn method expects what type of information in its parameters? Mark for Review
(1) Points
Parameter void
True or false response
Integer of steps to move forward
Degrees to turn (*)
String statement
4. In Greenfoot, methods can be called in the act method. When the Act button is clicked in the environment, the methods in the method body of the act method are executed. True or false? Mark for Review
(1) Points
True (*)
False
5. Using the Greenfoot IDE, only five instances can be added to a scenario. True or false? Mark for Review
(1) Points
True
False (*)
6. In Greenfoot, the instance has a source code editor. True or false? Mark for Review
(1) Points
True
False (*)
7. In Greenfoot, the origin of the world coordinate system (0,0) starts in the center of the world. True or false? Mark for Review
(1) Points
True
False (*)
8. From your Greenfoot lessons, classes can only use the methods they have inherited. They cannot use methods from other classes. True or false? Mark for Review
(1) Points
True
False (*)
9. The list below displays characteristics of a Greenfoot world constructor, except for one. Which one should be removed? Mark for Review
(1) Points
Has no return type.
Has a void return type. (*)
Executed automatically when a new instance of the class is created.
Defines the instance's size and resolution.
Has the same name as the name of the class.
10. What does the following Greenfoot programming statement tell the class to do?
if (Greenfoot.getRandomNumber(100) < 6) { turn(18); } Mark for Review
(1) Points
Turn 6 degrees, then turn 18 degrees.
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, turn 18 degrees. (*)
If a random number is returned that is less than 6, move 18 steps.
11. In Greenfoot, you will not receive an error message if your code is incorrect. It will simply not work, and you will have to determine why the code doesn't work. True or false? Mark for Review
(1) Points
True
False (*)
12. In Greenfoot, what happens to an instance when the Act button is clicked in the environment? Mark for Review
(1) Points
The class executes all of the programming statements in their instance's act method two times 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 instance executes all of the programming statements in their class's act method repeatedly until the scenario is stopped.
Only one instance moves until the pause button is clicked.
13. In Greenfoot, after a subclass is created, what has to occur before instances can be added to the scenario? Mark for Review
(1) Points
Creation of an instance
Editing of source code
Creation of source code
Compilation (*)
14. In Greenfoot, a subclass is created by right-clicking on a superclass. True or false? Mark for Review
(1) Points
True (*)
False
15. Which of the following Java syntax is used to correctly create a Bee subclass? Mark for Review
(1) Points
private class extends Actor
private Bee extends World
public class Bee extends World
public class Bee extends Animal (*)
private class extends Bee
2 komentar
pls gave me a code to play the doorbell just to ring the doorbell only id you press the keybord
Appreciate youur blog post
EmoticonEmoticon