Lesson 41: Break it down
Trang này cần trình duyệt gần đây (hỗ trợ SharedArrayBuffer). Vui lòng cập nhật Chrome, Edge, Firefox hoặc Safari lên phiên bản mới nhất.
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.
Độ khó 3/5 · 200 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
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 sử dụng draw_walls và draw_roof. Write those two procedures. The robot then goes on to draw the fence.
Nhấn Chạy để xem kết quả ở đây.
Độ khó 3/5 · 200 xu + phần thưởng nhỏ khi hoàn thành lần đầu tiên hôm nay
Now the other branch of the diagram: draw_fence sử dụng 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.
Nhấn Chạy để xem kết quả ở đây.