Decompose a program to run a quiz.
- Load questions; display a question; get and check the answer.
- Update the score; repeat; show the final result.
- Each part becomes a subroutine.
Answer Load, ask, check, score, report
A-level Computer Science revision · Computational thinking
Decomposition breaks a complex problem into smaller sub-problems that are easier to solve, test and assign to different programmers. Thinking procedurally means identifying the steps and their order. Thinking logically means identifying decision points and conditions.
Watch out Each sub-problem should be small enough to be solved by one subroutine.
Decompose a program to run a quiz.
Answer Load, ask, check, score, report
What is a benefit of decomposition?
What is thinking logically?
Explain how a top-down design helps a programming team.
Answer The problem is split into modules with clear interfaces, so different programmers can build and test them separately, then combine them.
A-level Computer Science Pro, OCR H446
£119 once
Price rises to £199 on 1 January. Save £80 by joining before then.
At least 12 months of access
No VAT is charged.