1.9 – Introduction to If Statements
Lesson Overview
In this lesson, students will continue to develop their understanding and programming skills by looking at a concept called if statements. Students will be asked to relate if statements to situations in real life before creating a small program where Marty responds to inputs such as random numbers or user input.
- If statements , Coding Blocks , Functionality , Condition , Decisions,
Content Sections
1.9 – Introduction to If Statements
Lesson Overview
In this lesson, students will continue to develop their understanding and programming skills by looking at a concept called if statements. Students will be asked to relate if statements to situations in real life before creating a small program where Marty responds to inputs such as random numbers or user input.
- If statements , Coding Blocks , Functionality , Condition , Decisions,
- Lessons 1.1-1.8
- Laptop, PC or Tablet
-
- Marty the Robot
- Marty Workbook (Lesson 5)
- Laptops/Computers/Tablets
- Access to the Scratch editor
Learning Objectives
- Consider the actions and tasks that we could use robots like Marty to do
- Understand how to read if statements and predict outcomes
- Use if statement coding blocks to program Marty to respond to inputs
1. Now that students have had a lot of time programming with Marty, they should now have an idea of what functionalities Marty has. Discuss with the class what tasks or things that they think robots like Marty could do
2. Introduction to if statements and compare to real life situations like the following IF there is a green man, THEN it is safe to cross the road
3. Ask students to think up some of their own examples of if statements
4. Split into groups so that there are 2-3 students per Marty and ensure that Marty is connected to a Scratch editor
5. Programming task of creating a Marty Magic 8 Ball where we will generate a random number and Marty will respond to this with an action or movement based on the number that is generated
Extensions & Support
- Using the ask blocks like in the previous lesson, students could ask users questions and use their inputs as a way to decide what actions Marty should respond with
Additional Reading
- Educator’s Guide
- Introduction to Programming with Marty using Scratch