Lesson 41: Break it down
Esta página precisa de um navegador recente (com suporte a SharedArrayBuffer). Por favor, atualize Chrome, Edge, Firefox ou Safari para a versão mais recente.
English
One big job, many small jobs
- A big problem is easier when you break it into smaller parts: decomposition.
- A structure diagram shows the parts. The top box is the whole job; each box under it is a smaller job.
- In the program, each box becomes a procedure.
Words for this lesson
| Word | Meaning |
|---|---|
| decomposition | breaking a problem into smaller parts |
| structure diagram | a diagram of the parts and sub-parts |
| sub-procedure | a procedure that does one part of a bigger job |
English
The structure diagram
- main: draw the picture
- draw_house
- draw_walls
- draw_roof
- draw_fence
- draw_post (3 times)
- draw_house
English
In the exam
- 0478/21/O/N/23 Q5(b): identify three component parts of a problem after decomposition. Mark scheme: inputs, processes, outputs, storage.
- 0478/22/F/M/23 Q5: complete a structure diagram for a food ordering system: each part is split into smaller parts, as in the diagram above.
Dificuldade 3/5 · Moedas 200 + pequeno bônus na primeira conclusão hoje
Draw a house and a fence with the pen. The job is broken down into parts, like the structure diagram on this page: draw_house usa draw_walls e draw_roof. Write those two procedures. The robot then goes on to draw the fence.
Clique em Executar para ver a saída aqui.
Dificuldade 3/5 · Moedas 200 + pequeno bônus na primeira conclusão hoje
Now the other branch of the diagram: draw_fence usa draw_post three times. Write draw_post (left 90, up 200 mm, back 200 mm, right 90, then 150 mm on to the next post) and draw_fence.
Clique em Executar para ver a saída aqui.