Menu

Inputs, Processes and Outputs

Inputs

An input is data that enters a program or system so that it can be used. Without inputs, a program could only work with values it already holds, so it could never react to a new customer, a new reading or a new choice.

Where inputs come from

  • A user — someone scans a membership card at a till or speaks a command into a microphone.
  • A file — data saved earlier, such as a list of prices or a set of saved settings, is read into the program.
  • A sensor — a device measures something in the real world and passes that measurement in, such as a soil moisture level or a distance.

In all three cases the data comes from outside the program, which is exactly what makes it an input. Data does not have to come from a person: a reading taken by a sensor is just as much an input as a barcode scanned at a till.

Inputs are not the program's own values

Data that the program has already worked out and stored in a variable is not an input, because it came from inside the program. An input is the new data handed in from outside. When a user types a value in reply to input(), that typed value is the input; the variable it is stored in is only a name the program uses afterwards.

Worked example: watering system

A garden watering system needs three pieces of data before it can choose how long to water for.

InputWhere it comes from
The moisture level of the soil, as a percentageA soil moisture sensor
The maximum run time allowed, in minutesA settings file read by the program
The plant type chosen by the gardenerThe user

Each of these comes from outside: the moisture level was measured rather than calculated, the maximum run time was loaded from a file, and the plant type was chosen by a person. Naming the actual data item, such as the soil moisture percentage rather than a vague label, is what makes an input clear.

Practise this

OCR GCSE Computer Science · Inputs, Processes and Outputs