Sequencing and Program Flow
Doing things in the right order, one step at a time
- say what a sequence is,
- read steps from top to bottom and tell what happens first, next, and last,
- explain why changing the order changes the result.
1. What is a sequence?
A sequence is a set of steps done in order, one after another. Each single step is called an instruction.
A computer does not do everything at once. It starts at the first instruction, finishes it, then moves to the next one, then the next — all the way down the list. This is called program flow: the path the computer takes as it moves through the steps.
Think of counting to three. You say "one", then "two", then "three". You cannot say all three at the exact same time, and saying them out of order would sound wrong. A computer works the same way — one step at a time, in order.
2. Steps run from top to bottom
When we write a program, we stack the steps in a list. The computer always starts at the top and works its way down to the bottom.
Read the boxes from top to bottom: first you wake up, next you get dressed, then you eat breakfast, and last you go to school. The computer follows a program the very same way.