The title sounds like a nasty affliction – but I actually want to describe a great lesson!
I was looking for a nice challenge for my Year 9 Computing class to continue developing their understanding of variables, if statements and loops – ideally moving on to nested statements and loops.
As ever Twitter came to the rescue when politely asked.
I decided to break this into 4 challenges so that I could scaffold the learning a little for the group, their challenge was to :
- Build a program that asked for an input number and then either repeated the number or said ‘Fizz’ if it was a multiple of 3.
- Extend so that multiples of 5 reply ‘Buzz’.
- Extend so that multiples of 3 and 5 return ‘FizzBuzz!’
- Change program so that rather than returning just one value it counts up from 1 to a user inputted number.
This turned out to work really well – particularly part 3. Students tended to duplicate code and check sequentially for the different multiples. Meaning that an entry of 15 would often output all three responses. When I pushed students to adapt their program to return just ‘FizzBuzz’ in this case they began to think in depth about how their If then Else statements worked and to experiment with nesting the statements. Finally part for introduced loops to their previous work.
By then end students had a great understanding of how and why you would nest statements and a much better idea of when a program would cease based on a True If statement and when it would continue.
Here’s an example of a finished Scratch program: