Practice question · Put in order
Order the steps of top-down decomposition as the lesson describes it.
- Refine any sub-task that is still too complicated into smaller ones
- Break the task into a few major sub-tasks
- Give each sub-task a clear name and a defined job
- Stop when every remaining piece is simple enough to write directly
- State the whole task in one sentence
Hints
- Top-down means starting at the largest scale and working downwards.
- Refinement can only be applied to pieces that already exist and are already named.
Show the answer
- State the whole task in one sentence
- Break the task into a few major sub-tasks
- Give each sub-task a clear name and a defined job
- Refine any sub-task that is still too complicated into smaller ones
- Stop when every remaining piece is simple enough to write directly
Why
Decomposition starts from the whole and repeatedly splits, naming each piece as it goes, until nothing left is complicated. Starting from small pieces and gluing them together is bottom-up, which is a different discipline; the top-down order is what keeps each level a complete description of the level above.
Practise Structured Program Design
The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Structured Program Design
- Select every statement that is a consequence of the structured program theorem as the lesson states it.
- Dijkstra's "Go To Statement Considered Harmful" argued about human limits, not machine ones. What exactly was…
- Structured programming allows only sequence, selection and iteration, and it was proved that these three…