MIDTERM 1 VAR 2 1. In Alice, we can avoid object collision using what? Slowing movements down. Using math operators. (*) Downloading the Alice3 collision detector app. Using object detection. 2. From your Alice lessons, which of the following are examples of scenarios? Conflict and resolution in a play Process to simulate Process to demonstrate Game to play All of the above (*) 3. In Alice, which of the following is the most likely situation where procedural abstraction could be used? Five dogs all need to bark and run at the same time. (*) One fish needs to swim forward 1 meter. Two fish say something to each other. One person moves up 10 meters. 4. In Alice, objects inherit the characteristics of their: Code Project Class (*) Program 5. In Alice, inheritance means that the superclass inherits its traits from the subclass. True or false? True False (*) 6. In Alice, which function is used to move an object directly to the center point of another object? getObject getDuration getDepth getDistance (*) 7. Do In Order and Do Together are the only control statements available in Alice. True or false? True False (*) 8. In Alice, once procedures are added to a control statement, they cannot be changed. True or false? True False (*) 9. Which of the following are examples of comments written in an Alice program? this.dog move forward 2 this.cat turn left 0.5 Boy runs to the girl. (*) Cat jumps into the tree and meows for help. (*) 10. In the Alice scene editor, where are the procedures located to precisely position an object? Right click on the object, then select Procedures. (*) Right click on the object, then select Remove. In the gallery of classes. In the package located in the gallery. 11. Besides invoking a procedure, another way to precisely position an Alice object is to enter values in the x, y, and z coordinates in the Position property. True or false? True (*) False 12. Alice objects move relative to the orientation of the person viewing the animation. True or false? True False (*) 13. The value that a variable holds must be a whole number, not a decimal. True or false? True False (*) Midterm1 var 2 1 14. Define the value of the variable NumSpins based on the following math calculation: NumSpins / 3 = 8 12 24 (*) 8 NumSpins 15. From your Alice lessons, the "Checklist for Animation Completion" does not ask questions about the scenario and storyboards, because these are not valid parts of the animation creation process. True or false? True False (*) 6. From your Alice lessons, which control statement executes instructions simultaneously? Do in order Count Variable Do together (*) 17. In Alice, which of the following instructions roll the Blue Tang fish left 1 meter? this.blueTang roll Left 1.0 (*) this.blueTang Left 1.0 this.blueTang Left 1 this.blueTang roll Left 1 18. How do you copy an Alice procedure? Drag the procedure into the clipboard, then click CTRL + C. Hold down the control (CTRL) key, then drag the procedure into the clipboard. (*) Drag the procedure into the clipboard. Select Copy in the Run menu. 19. Expressions with relational operators produce true and false values. True or false? True (*) False 20. In Alice, where are arithmetic operators available? Amount argument (*) Size argument Duration argument (*) Get Distance functions (*) If control 21. Which of the following is not an example of the logic of an IF control structure? 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. 22. The condition in a WHILE loop is a boolean expression. True or false? True (*) False 23. What Alice tool can be used to diagram the If conditional execution statement? Cause and effect diagram Process flow diagram (*) Conditional flow diagram 24. The Alice If control structure requires the false statement to be populated. True or false? True False (*) 25. A conditional loop is a loop that will continue forever. True or false? True False (*) 26. From your Greenfoot lessons, the reset button resets the scenario back to its initial position. True or false? True (*) False 27. In Greenfoot, a subclass is created by right-clicking on a superclass. True or false? True (*) False 28. From the Greenfoot IDE, where are inherited methods located? In the computer network Midterm1 var 2 2 In the Greenfoot image gallery In the scene editor 29. What does the following Greenfoot programming statement do? turn(18); Turn the object 36 degrees. Turn the object 18 degrees. (*) Turn the object 18 steps forward. Move the object 18 steps forward. 30. In the Greenfoot IDE, which type of variable allows instances to store information? Method variable Instance variable (*) Class variable World variable 31. Use your Greenfoot knowldege: Abstraction occurs in many different ways in programming. True or false? True (*) False 32.From your Greenfoot lessons, abstraction techniques can only be used once in a class's source code. True or false? True False (*) 33. 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 34. Use your Greenfoot knowledge: A specification of a method is called a __________________. Subclass Class Signature (*) Parameter 35. In Greenfoot, dot notation is used to call a _____________ from another class. Method (*) Class Signature Parameter 36. In Greenfoot, defined methods must be used immediately. True or false? True False (*) 37. From your Greenfoot lessons, how do you call a defined method? Call the method from the act method. (*) Call the method from the defined method. Write the method in the World superclass. Write the method in the instance. Write the method in the source code. 38. From your Greenfoot lessons, to save space in the act method, you can write an entirely new method below it, called a _____________. Class method Instance method Defined method (*) World method Code method 39. When a Greenfoot code segment is executed in an if-statement, each line of code is executed in sequential order. True or false? True (*) False Midterm1 var 2 3 40. From your Greenfoot lessons, which type of constructor can be used to automate creation of Actor instances? Animal World (*) Actor Vector 41. From your Greenfoot lessons, when does an if-else statement execute it's second code segment? When a random number is less than 10. When an instance is created. After the first code segment is executed. If a condition is false. (*) If a condition is true. 42. From your Greenfoot lessons, which symbol represents string concatenation? Symbol & Symbol < Symbol = Symbol + (*) 43. How would the following sentence be written in Greenfoot source code? If Duke's leg is down, and the keyboard key "d" is down... if (&&isDown ! Greenfoot.isKeyDown("d") ) if (!isDown && Greenfoot.isKeyDown("d") ) if (isDown && Greenfoot.isKeyDown("d") ) (*) if (!Greenfoot.isKeyDown && isDown("d") ) 44. Use your Greenfoot knowledge to answer the question: String concatenation is a way to avoid having to write additional characters in your source code. True or false? True (*) False 45. In Greenfoot, which method is used to add a new instance to a scenario when the world is initialized? addClass addWorld addObject (*) addInstance 46. In Greenfoot, an if-statement is used to alternate between displaying two images in an instance. True or false? True False (*) 47. In Greenfoot, a constructor has a void return type. True or false? True False (*) 48. From your Greenfoot lessons, a problem statement defines the purpose for your game. True or false? True (*) False 49. In Greenfoot, what type of parameter does the keyDown method expect? String (*) Boolean Integer Method 50. In Greenfoot, which method checks if a key on the keyboard has been pressed? keyPress method keyUp method keyDown method (*) keyClick method Midterm1 var 2 4