Notes on Sequencing with Block Coding
Chapter 2 - TouchPad
Chapter Overview
This chapter covers sequencing in programming, its importance, and its relationship with loops,
selection, and iteration.
Recap of Loops
Iteration: Repeating code.
Loop: Executes code until a condition is met.
Break: Ends a loop early.
Continue: Skips to the next loop iteration.
Nested Loop: A loop within another loop.
What is Sequencing?
Algorithm: Step-by-step instructions to solve a problem.
Sequencing: The specific order of steps to get the correct outcome.
Example: Making a sandwich requires following steps in the correct order, just like tasks in
programming.
Examples of Sequence, Selection, and Iteration
Sequence: Swapping two numbers requires following exact steps.
Selection: Choosing actions based on conditions, like checking if someone is a senior
citizen.
Iteration: Repeating steps, such as printing numbers from 1 to 100.
What is a Bug?
Bug: A flaw causing a program to behave unexpectedly.
Activity: Drawing a Rectangle
Steps:
1. Draw a 5 cm line.
2. Turn right 90 degrees.
3. Draw a 3 cm line.
4. Repeat until a rectangle is formed.
Correct sequencing ensures the rectangle is drawn accurately.
Minecraft Activity