130 likes | 265 Views
Global Challenge Walking for Water Lesson 2. Recap questions What are some benefits of walking? How many steps does the NHS recommend we walk everyday? Why do we walk less than we used to? What are the advantages and disadvantages of us walking less? How far does Aysha walk every day?
E N D
Global Challenge Walking for Water Lesson 2
Recap questions • What are some benefits of walking? • How many steps does the NHS recommend we walk everyday? • Why do we walk less than we used to? • What are the advantages and disadvantages of us walking less? • How far does Aysha walk every day? • What is the ‘Water Burden’? • How does having to walk for water impact on Aysha’s life? • What is your challenge?
Your challenge Walk as many steps as Aysha does in 1 day over 4 days.
Learning objectives: • to use decomposition and abstraction effectively to solve a problem • to write, test and debug accurate algorithms and programs • to use iteration, loops and variables to write efficient algorithms and code
The first part of the challenge • create a step counter using micro:bit
Think: • what do we need to do to complete this part of the challenge? • what tasks? • in what order?
Decomposition • breaking down a complex problem into smaller, component parts. Algorithm • a sequence of instructions or rules to solve a problem • written for a person to follow to write code Abstraction • focussing only on the important parts • filtering out unnecessary detail
Programming • using an algorithm to write code a computer can understand Testing & debugging • regularly checking for, finding and correcting errors Iteration • The repetition of a sequence. Loops are a form of iteration (repeat until a certain condition is met) Variables • used to store information, e.g. number of steps
Pseudocode • A simple way of describing an algorithm • No specific syntax (programming language)
Step tracker example algorithm • On START • Set ‘steps’ to 0 • OUTPUT ‘steps’ on visual display • REPEAT forever • When sense movement • add 1 to ‘steps’
Paired programming • 2 programmers working together to code • One types the code (driver) • One watched the driver, checks the code, makes suggestions (navigator) • work collaboratively, talking through problems • Why might this be helpful? • more accurate code written in shorter time • can collaboratively work through problems
Learning objectives: • to use decomposition and abstraction effectively to solve a problem • to write, test and debug accurate algorithms and programs • to use iteration, loops and variables to write efficient algorithms and code