Alice Chapter 1-5 Review SOLUTIONS Name:___________________ Date:______________- 1. Select from the following scenarios example(s) in the real world around us which is not considered interactive. a. changing the channel on a television set by sending a signal from a remote control b. pressing a button on a game controller to make a character in a video game jump out of the way of danger c. going to the movie theatre to watch this weekend's newest blockbuster hit d. completing an online test through the answering of various questions via check boxes and submit buttons 2. In Alice, a mouse click or key press, used to trigger some action, is known as a(n) ____________. a. function b. event c. method d. call 3. How do events affect the animation programmer? a. The programmer must write animation methods to carry out responses to the events. b. The programmer must think about all possible events and make plans for what should happen when each event occurs. c. The event must be linked to the responding method. d. all of the above 4. Animation methods that are written to carry out responses to events are known as ____________. a. parameter calling methods b. interactive methods c. event handling methods d. keyboard-control methods Questions5-8 are based on the following Alice world which contains a penguin and a tree. The penguin's class-level methods perform the expected actions as their names suggest. 5. When the above world is played, and no keys are pressed on the keyboard, how far will the penguin move? a. 0 meters - the penguin won't move The penguin turns but it doesn't move b. 2 meters c. 5 meters d. 10 meters 6. When the above world is played, and no keys are pressed on the keyboard, how high will the penguin jump? a. 0 meters - the penguin won't jump b. 1 meter c. 2 meters d. 4 meters 7. Suppose that the above world is played, and each potential arrow-key event occurs once, how far will the penguin walk? a. 0 meters -- the penguin doesn't move b. 2 meters c. 5 meters d. 10 meters 8.Suppose that the above world is played, and each potential arrow-key event occurs once, how high will the penguin jump? a. 0 meters -- the penguin doesn't jump b. 1 meter c. 2 meters - if there is no coming down motion in the method the penguin jumps 1 meter each time the loop is executed. d. 4 meters 9. Mad Scientist Magic Who says that a mad scientist has no magic skills? Create a world using a mad scientist (People) behind a table (Furniture) . Place three objects on the tabletop- for example a blender and mug(Kitchen). The point of this exercise is that when the mouse clicks any one of the objects on the tabletop, the mad scientist will turn to face that object, raises his arm (like he is casting a spell of some sort), and have the object spin or turn in any way you wish. The mug has some kind of liquid in it. Make the liquid disappear (by setting its isShowing property to false) when the mad scientist performs his “ spell” on it. (a) How many methods are needed in this world? Are they world-level or class-level? Three class-level methods are written to make each object spin in its own special way. (b) How many events are required in this world? Three events will be made – one each for each mouse click on each object e.g. When mouse is clicked on mug do mug.coffeeDisappear see picture above (c) Write a method called castSpell as a class-level method for the mad scientist. It takes one parameter named whichObject of Object type. When an object in the world is being clicked, invoke castASpell method and pass that object as the argument. Since some special effects need to be applied to the mug, in this castSpell method, add a statement to check whether the object being clicked is the mug or not, if so, make the liquid disappear, otherwise do nothing. SEE BELOW
© Copyright 2026 Paperzz