Day 4
Day 4: Making the Field Trip Interactive
Learning Objectives
Students will know the steps in an iterative design process - plan, code, test, debug (5.4)
Students will know the code needed to create conditionals (if-statements) in their code (5.1e)
Students will be able to use conditionals to add interactivity to their project (5.1e)
Students will know to expect bugs in their code (5.3)
Students will know how to use debugging (problem solving) strategies to fix bugs in their code (5.3)
Students will be able to debug their project (5.3)
Activity
Introduce students to the activity. Tell students that they should finish coding events into their project before adding interactivity.
Ask students for examples of times they had to make decisions based on an if-statement something happened. For instance, if it rains, then I know I need an umbrella.
Using if-statement [SOL 5.1e] in coding is also known as conditionals [SOL 5.1e]. If-statements are often used in conjunction with sensing things in your environment, like using your eyes to see it is raining or your hand to feel the rain. In this lesson the environment is in Scratch, so students will be using sensor blocks to determine if a sprite is touching another sprite.
Demo to the class how to use if-statements and sensing to make the project interactive (watch the Using sensing to add interactivity video for help). You can find sample code here.
Students work on their projects:
Finding problems in your code and debugging [SOL 5.3] them is common and expected. Nobody’s code works perfectly the first time through.
Adding interactivity can be an optional activity as a way to differentiate [CS teaching strategy] the project. Another is to employ students who wrap up early as peer mentors for others.
If a student thinks they are done, ask them to think about the user experience of their field trip and what they could do to improve it?
Discussion
Ask students about if and how they have had to change their plans.
Exit ticket
Link to students Scratch projects.
Take a screenshot of code in your Scratch project that shows an example of using an event. Does it currently work? Why or why not?
ORTake a screenshot of code in your Scratch project that shows an example of using a conditional. Does it currently work? Why or why not?