5.1 Exploratory Homework

5.1 Exploratory Homework - method is now said to be an...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
5.1 Exploratory Homework 1) Computer programming with movie-style animations are computer-centric, meaning the computer program basically runs as the programmer has intended it. The programmer sets the order of actions and controls the program flow. However, many computer programs today are user-centric. In other words, it is the computer user who determines the order of actions. The user clicks the mouse or presses a key on the keyboard to send a signal to Alice about What to do next. The mouse click or key press is an event. An event is something that happens. In response to an event, an action is carried out. 2) An event triggers a response. I must thing about all possible events and make plans for what should happen- responses to the events. Animation methods are then written to carry out responses. Finally, the event must be linked to the responding method. This
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: method is now said to be an event handling method. 3) When three event handling methods are exactly the same, we could use parameters to write just one and send in the information needed to perform the action. 4) In an event-driven program, the response to an event may involve multiple actions. Writing an event handling method to carry out the response can become messy. One way to deal with a complex response is to use stepwise refinement to break down the event handling method into smaller pieces. It helps manage multi-action response to an event. 5) Step-wise function helps the readability of the program because you could test a small piece of your program then write and test the next small piece, and so forth, until the entire program is completed....
View Full Document

Ask a homework question - tutors are online