A2.1 Decomposing: small steps first
A big job is easier when you break it into small steps — that is called decomposing. To code a robot to draw a square, the small steps are *forward, turn, forward, turn…* Write the small steps, then put them in order.
Example
List the small steps for making a sandwich that a robot could follow.
- Big job: make a sandwich. Small steps: get two slices; spread butter on one; add cheese; put the other slice on top.
- Order matters: cheese before the top slice.
- Test by following the steps exactly; if the robot gets stuck, a step is missing.
A2.2 How coding changes daily life
Example
Describe what code does in a washing machine and a crosswalk button.
- Washing machine: code runs fill, wash, spin in order, so clothes come out clean without anyone watching.
- Crosswalk button: code tells the light to change so people can cross safely.
Example
Describe what code does in a smoke alarm.
- Smoke alarm: code checks for smoke again and again and sounds the alarm, so a family wakes up in time.
Summary
- Decompose: big job into small steps, in order.
- A missing step stops the program.
- Code runs machines that keep people safe and save time.