Pseudocode Your Morning

Grade 3 • 30 minutes

Created by Caitlin Davey on 29/8/16

Introduction

Students will create a map or list of instructions of a morning activity. This activity can be run independently or in groups of students.

Prep Work

Materials

  • Pen
  • Paper
  • Optional: 2 coloured pens/highlighters

The Lesson

  • Explain an algorithm as a plan or step-by-step instructions for solving a problem. 
  • When you make a plan there may be lots of different ways to solve a problem. 
  • When you are solving a problem it helps to know what the problem is and what outcome you want to end up with. It also helps to make a plan of the steps it takes to get the outcome you are hoping for.
  • Explain that computers have different languages that we use to give them instructions these are called programming languages. 
  • When we are thinking through a program we’d write for a computer it helps to write something called pseudocode. This is “fake” or human readable code that follows the same process or procedural step-by-step way computers need in order to understand something we want them to do.
  • In walking students through a pseudocode activity you can first explain functions, conditionals, and loops
  • the sample pseudocode attached can serve as a way to introduce students to the syntax of pseudocode. 
  • Some programming languages have very strict rules whereas pseudocode can be written in anyway since we aren’t dependant on a computer to read it. The important thing is that the plan is clear and that we understand the steps that we’d need to communicate to a computer. 
  • Explain to students that the yellow highlighted steps are if/else statements or moments where you’d stop and make a choice juice or milk. 
  • The pink highlights are loops or steps where you are doing something repeatedly such as taking sips of a drink.
  • The steps that are not highlighted can be called statements or functions or procedures. These functions are pretty straight-forward these steps won’t change based on a condition like the weather or their choice of breakfast meal. 

Activity

  1. Have students choose one aspect of their morning to “code” or map e.g. eating breakfast, brushing their teeth, riding a bus/bike to school, morning announcements. 
  2. If students are confused about where to start let them know that as per the example they can add start at the beginning and stop at the end. 
    • Once the students have chosen their activity have them write out each step it took to complete this activity as if they were explaining it to an alien or someone who had never done this before. 
  3. Prompt students by having them reflect on what steps they might overlook because they have done this activity before. 
    • Encourage students to explain the concepts to each other and overcome any confusion they may have around these new terms. 
    • Have students incorporate one or two choices in their map of their morning. 
  4. Explain to students that they have just written an algorithm for their morning. As per the definition of an algorithm they have written a step-by-step set of instructions for the task they chose at the beginning of the lesson.
  5. When students have finished their steps ask if there are any steps that had a choice in them?
    • For example did they choose to put on rain boots because it was raining? Did they choose between two breakfast foods cereal or bread?
    • Now have students go through their steps and find the points where they made a choice and highlight those steps in yellow or draw a square around them. 
  6. Next ask if there are any steps that are repeated? For example if they chose brushing their teeth do they just push the tooth brush back-and-forth once? No they’d do that multiple times OR if they chose eating breaking do they just take a bite of cereal once? No they would take multiple bites of cereal. 
  7. Have students highlight the steps that get repeated in pink OR have them circle those steps. 
  8. Explain the rest of the steps that are not highlighted would be considered the statements, or functions, or procedures.
  9. The yellow or square steps would be the conditionals they are decision points where a condition was met or not met to influence the outcome. Computers are great at using these steps to decide what to do next in a program or plan.  
  10. The pink or circled steps are can be called loops. Computers are really good at these repeating commands. In them a step gets repeated several times.
  11. Explain that computers seem really smart but in fact are only good at following instructions step-by-step just like we did with the pseudocode.  

Extensions

  • Did it take more or less steps than you thought to map out the activity you chose?
  • Were there any concepts that were super confusing or you didn’t understand? See if you can have another student explain it to them as the “coding advocate”. 
  • Did they do these activities in the a.m. or p.m.?
  • Students could also go through and add duration estimates beside each step and add up the total time to do the activity. 

Suggested Lessons

Intended Province:

All

  • Subjects:
  • Math

Key Curriculum Concepts

  • Time
  • AM/PM
  • Duration
  • Before/after

Key Coding Concepts

  • Pseudocode
    Pseudocode is a way of explaining code in steps that are understandable to humans. Pseudocode won’t actually work on a computer but it can help programmers better understand the way computers think. 

    Algorithm
    An algorithm is a term for a step-by-step list of instructions that a computer will follow. You can think of it as a plan. 

    Function
    A named piece of a program that performs a specific task. These are actions e.g. DO this _____

    Conditionals
    Conditions mean that we are checking to see if a specified requirement is met in order to run a piece of code or in this case a step. E.g. IF it was raining THEN I would put on a rain jacket as I was getting ready. IF it was not raining THEN you wouldn’t put on a rain coat 

    Loops
    Are pieces of code that get repeated. 

    Syntax
    Rules of how to write statements in a programming language