Menu

Inputs, Processes and Outputs

Planning Inputs, Processes and Outputs

Before you design an algorithm, identify the problem's inputs, processes and outputs. This makes clear what data enters the program, what work is done with it, and what results are produced, so the algorithm you design later has a job for every piece of data.

An example breakdown

A car park ticket machine asks how many hours you want to park for and accepts coins. Breaking the problem down gives you:

PartWhat it covers
Inputsthe number of hours parking is needed, and each coin inserted
Processesadding the coins to find the amount paid, multiplying the hours by the fixed hourly rate to find the cost, comparing the amount paid with the cost, subtracting the cost from the amount paid to find the change
Outputsthe printed ticket showing the hours paid for, the change returned, a message on the display

Why do it before designing

  • Every process needs the data it works on to be available. A fixed hourly rate is known in advance, but the hours and the coins must be supplied before they can be used.
  • Every output has to be produced by something. The machine can only return the correct change because a process has subtracted the cost from the amount paid.
  • You spot gaps early rather than halfway through writing the algorithm, and you avoid asking for data you never use or leaving out a result the program should produce.

Once the three lists are settled, the design is mostly about order: get the inputs, carry out the processes in a sensible sequence, then produce the outputs. The order is forced by the data, because the cost cannot be compared with the amount paid until the coins have been totalled.

Practise this

OCR GCSE Computer Science · Inputs, Processes and Outputs