Inputs, Processes and Outputs
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.
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.
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.
A garden watering system needs three pieces of data before it can choose how long to water for.
| Input | Where it comes from |
|---|---|
| The moisture level of the soil, as a percentage | A soil moisture sensor |
| The maximum run time allowed, in minutes | A settings file read by the program |
| The plant type chosen by the gardener | The 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.
OCR GCSE Computer Science · Inputs, Processes and Outputs