Algorithm Design and Standard Methods: Question 2
Syllabus 7.1, 7.2
An allotment society is having a new system developed so that members can reserve one of the society's garden plots for the coming season and order bags of compost to be delivered to that plot.
(a) State what is meant by decomposition, as used in the analysis stage of the program development life cycle. [2]
(b) The systems analyst decomposes the plot-reservation problem into inputs, processes, outputs and storage. Identify one example of each of these four for this system. [4]
(c) Explain one benefit, other than making the problem easier to understand, of decomposing a problem in this way before an algorithm is designed. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): Defining decomposition
Decomposition is a task carried out during the analysis stage of the program development life cycle, alongside abstraction. It means:
Breaking a large, complex problem down into a number of smaller sub-problems (sub-systems), each of which is small enough to be understood, designed, coded and tested on its own.
[1 mark] for the idea of breaking a problem into smaller parts, [1 mark] for the idea that each part becomes manageable enough to be designed/coded/tested on its own.
Part (b): Decomposing the plot-reservation problem
Looking at the scenario, the analyst can identify one example of each of the four categories:
- Input, the plot number and the reservation dates entered by the member. [1]
- Process. Checking whether the chosen plot is already reserved for an overlapping period. [1]
- Output. A confirmation message showing the plot and dates that have been reserved. [1]
- Storage. A stored list (or database) of which plots are already reserved and for which dates, so future reservation requests can be checked against it. [1]
Each of these is a distinct sub-system that could be designed and tested independently of the others (for example, the compost-ordering sub-system is separate from the plot-reservation sub-system, even though both belong to the same overall problem).
Part (c): A benefit of decomposing before designing an algorithm
Because each sub-system identified in part (b) is self-contained, it can be designed, coded, tested and debugged separately from the rest of the system. [1] This means an error found while testing the plot-reservation sub-system does not require the compost-ordering sub-system to be re-checked, and it also means different sub-systems could be built by different programmers working at the same time, rather than one person having to solve the whole problem in one piece. [1]
Final answers
- (a) Decomposition = breaking a problem down into smaller sub-problems that can each be designed, coded and tested on their own.
- (b) Input = plot number/dates entered; Process = checking for an overlapping reservation; Output = confirmation message; Storage = stored list of existing reservations.
- (c) Sub-systems can be designed, coded, tested and debugged independently (and potentially by different programmers at the same time).