How to use the
Learning Portal

Learning Portal

Our hands-on, comprehensive lesson plans span a range of levels. Browse our free STEM and coding learning resources.

Marty Image

1.9 – Introduction to If Statements

45 Minutes

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.

Key vocabulary:
    If statements , Coding Blocks , Functionality , Condition , Decisions,

Content Sections

  • Learning Objectives
  • Extensions & Challenges
    • Additional Reading
    • 1.9 – Introduction to If Statements

      45 Minutes

      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.

      Key vocabulary:
        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