Section 3 - Quiz 2 L6-L10 (Answer all questions in this section) 1. Which actor method is used to detect a simple collis
Views 145 Downloads 15 File size 23KB
Section 3 - Quiz 2 L6-L10 (Answer all questions in this section) 1. Which actor method is used to detect a simple collision? Mark for Review (1) Points isTouching() (*) hasTouched() isInContactWith() isCollision() hasCollided()
Correct
contact? (1) Points
Correct 2. A collision in Greenfoot is when two actors make Mark for Review
True (*) False
Correct
method? (1) Points
Correct 3. From your Greenfoot lessons, how do you call a defined Mark for Review
Call the method from the act method. (*)
Write the method in the instance. Write the method in the Actor class. Write the method in the documentation. Write the method in the World superclass.
Correct
Correct
4. In Greenfoot, which method checks if a key on the keyboard has been pressed? Mark for Review (1) Points keyPress method isKeyUp method isKeyDown method (*) keyClick method
Correct
Correct
5. In Greenfoot, which method would you use to obtain input from the user? Mark for Review (1) Points getInput() input() getText()
ask() (*)
Incorrect
Incorrect. Refer to Section 3 Lesson 7.
6. From your Greenfoot lessons, the isKeyDown method is located in which class? Mark for Review (1) Points Greenfoot (*) World Actor GreenfootImage
Correct
Correct
7. From your Greenfoot lessons, what is the parameter of the following constructor that creates a new image, and designates it to the Actor class? setImage (new GreenfootImage("Bee01.png")); Mark for Review (1) Points setImage Bee01.png (*) GreenfootImage new
Correct
game? (1) Points
Correct 8. Which class holds the method that ends a Greenfoot Mark for Review
Greenfoot (*) Actor Class GreenfootImage
Incorrect
Incorrect. Refer to Section 3 Lesson 8.
9. Using the Greenfoot IDE, when is a constructor automatically executed? Mark for Review (1) Points When a new instance of the class is created. (*) When a new image is added to the class. When source code is written. When the act method is executed.
Correct
Correct
10. From your Greenfoot lessons, which one of the following is an example of when an abstraction technique is used? Mark for Review (1) Points
Adding a property to a Class Initialising a variable Passing a paramater in a constructor to set an initial speed. (*) Adding a property to an instance
Correct Correct 11. In Greenfoot you can only access the methods of the current class? Mark for Review (1) Points True False (*)
Correct
Correct
12. Writing more generic statements to handle the creation and positioning of many objects is one Abstraction technique? Mark for Review (1) Points True (*) False
Correct
Correct
13. In Greenfoot, which of the following statements could prevent an infinite loop from occurring? Mark for Review (1) Points
i=i I = 100 + i i = i + 1 (*) i=1
Correct
Correct
14. Use your Greenfoot knowledge: An array object holds a single variable. True or false? Mark for Review (1) Points True False (*)
Correct
or false? (1) Points
Correct 15. An array is an object that holds multiple methods. True Mark for Review
True False (*)
Correct
Correct