Students will be able to...
- Ask for and receive user input in a SNAP program
- Use simple conditional (if and if-else) blocks to alter control flow in a SNAP program
- Do Now 2.3: Stairs
- Lab 2.3 Handout - What Shape is That? (Download in Word) (Link to PDF)
Duration | Description |
---|---|
5 minutes | Welcome, attendance, bell work, announcements |
20 minutes | Lecture |
20 minutes | Activity - What Shape is That? |
10 minutes | Debrief and wrap-up |
Note: This lesson may cover too much material for some classes to handle in one day. Feel free to spill over into a second day, splitting the material however works best for your class.
##Instructor's Notes
-
Lecture
-
Point out that, so far, our programs have had minimal interactivity
- There was some user interaction in the shape drawing labs, but no back and forth-- just pushing a key to trigger an action
- This is not normally how computer programs work
- Ask students for examples of interactive computer programs
- Ask students for suggestions for making previous labs or activities more interactive
- There are no right or wrong answers here-- you're just trying to get students thinking about interactivity
-
- Demonstrate that it functions similar to the block but waits for a response from the user
- The response is stored in the block and can be referenced later
- Variables will not be introduced until unit 3, so this block will be somewhat magical for now. You should judge your students' preparedness to handle the details and act accordingly.
- Emphasize that only one input is stored at a time, and that asking a new question deletes the previous answer
-
Introduce conditional statements
- Define "conditional" - a block used to make a choice between executing two different chunks of code
- Point out the differences between and
- Namely, if-else provides a choice between two code paths, whereas if simply chooses between executing code or not
- Emphasize that only one of the bodies, either the if or the else, will ever be executed
- Show students the relational operators (<, >, and =)
- These should be fairly intuitive to most students
-
-
Activity
- Direct students to complete the What Shape is That? activity individually or in pairs
- Help students realize that, although they may seem quite different, parts 2.1 and 2.2 require very similar code
- Direct students to complete the What Shape is That? activity individually or in pairs
-
Debrief
- Discuss one or two students solutions
- Point out differences between the approaches of different students and lead discussion about advantages and disadvantages
- Place particular emphasis on the choice between if and if-else blocks
- Explain that, when conditions are mutually exclusive (as in part 2.1), a series of if vs. if-else blocks can be functionally equivalent
- When the conditions are not mutually exclusive (as in part 2.2), the choice matters more
- Discuss one or two students solutions
####Good for Classroom Instruction
- Why Study User Interfaces Ex:Mouse Xy axis, Sketchpad, PC, Tablets 15:00-25:00
- Example Project: Using Dexterity for Computer Interface Video 28:30-29:30
- Multi Touch Apps and Toolkits 32:00-End
####Background Information for Instructors
- Bjorn Hartman Background 0:00-3:30
- Human Computer Interface(HCI) 3:45-6:00
- HCI: Design, Computer Science, Applied Psychology 6:00-8:00
- Iterative Design Cycle 8:00-10:30
- Understanding Users 10:35-11:35
- Prototype Interface Examples 11:40-14:00
- Evaluation (Formative, Summative) 14:50
- Why Study User Interfaces Ex:Mouse Xy axis, Sketchpad, PC, Tablets 15:00-25:00
- What had changed? Research: Mainframe to Ubiquitous Computing 25:00-29:30
- Example Project: Using Dexterity for Computer Interface Video 28:30-29:30
- Zipf/Power Law Distribution 30:00-32:00
- HCI Research at Berkeley 32:10-46:25
- Multi Touch Apps and Toolkits 32:00-End
- Advanced students can be encouraged to add extra functionality, such as attempting to draw the shape the user is specifying or identifying types of triangles (equilateral, isosceles, scalene)
- Students who are struggling can be allowed to skip some parts of the tables in 2.1 and 2.2, focusing on just a few cases