Students will be able to...
- Use variables to track values throughout a program
- Do Now 2.4: Debugging
- Lab 2.4 handout - Guessing Game (Download in Word) (Link to PDF)
Duration | Description |
---|---|
5 minutes | Welcome, attendance, bell work, announcements |
15 minutes | Lecture and introduce activity |
25 minutes | Activity - Guessing Game |
10 minutes | Debrief and wrap-up |
-
Lecture
- Review user input, specifically the block
- Introduce variables
- Define and explain the concept of a variable
- a "place" to store a value for retrieval and use later
- Demonstrate creating, assigning, and accessing a variable in SNAP
- Ignore global vs. this sprite only for now
- Point out that a variable can only hold one value at a time
- When a new value is assigned, the old value is lost and cannot be recovered
- Emphasize the importance of descriptive, readable names for variables
- Show that variables are independent
- Define and explain the concept of a variable
-
Activity
- Briefly demonstrate the block, which will be used in the lab
- Direct students to complete Guessing Game individually or in pairs
-
Debrief
- Discuss and demonstrate one or more students' submissions
- Ask students for commentary on usage and naming of variables throughout program
- Advanced students can be encouraged to implement statistics (best score, average guesses/game, number of time each secret number chosen, etc.)
- Struggling students can be given code that completes part 1.1, and possibly also part 1.2, to get them started
- Students who are particularly overwhelmed should focus only on parts 1.2 and 2.2