- Computers and coding
- Classes 6-8
- 4 min read
Input, process, output
Every computer task takes input, processes it with steps, and gives output; learn to spot the three parts and write them in pseudocode.
Let us begin
The big idea
A calculator, a washing machine and a video game all do the same three things: take something in, work on it, and give something out. Computer scientists call this input, process, output. Once you can see these three parts, you can plan any program.
Input is what goes into the computer: numbers typed on a keyboard, a click of the mouse, a photo from a camera or a sound from a microphone. In a plan we write INPUT followed by the variable that stores it, for example INPUT length.
Process is the work the computer does with the input: adding, comparing, sorting, counting. This is where the steps of the algorithm live, for example area = length * breadth.
Output is what comes out: words on the screen, a printed page, a sound or a light. We write OUTPUT followed by what to show, for example OUTPUT area.
Writing a plan with these simple English-like words is called pseudocode. It is not a real programming language, so nothing runs it, but it is clear enough that a person could follow it, and it can be turned into any real language later.
Worked examples
See how it works
Area of a rectangle
INPUT length. INPUT breadth. area = length * breadth. OUTPUT area. Trace with length = 6 and breadth = 4: area = 24, and the output is 24.
Average of three marks
INPUT m1, m2, m3. total = m1 + m2 + m3. average = total / 3. OUTPUT average. With marks 70, 80 and 90: total = 240, average = 80.
Spotting the parts in daily life
A washing machine: input is dirty clothes, water and the programme you choose; process is washing, rinsing and spinning; output is clean wet clothes. A calculator: input is the keys you press, process is the sum, output is the number on the display.
Try it at home
Be the computer
You will need
- Paper slips for inputs
- A pencil
- A bowl
What to do
- On paper write this pseudocode: INPUT a. INPUT b. sum = a + b. double = sum * 2. OUTPUT double.
- Write five numbers on slips and put them in the bowl.
- A friend picks two slips (the input) and gives them to you. You are the processor: follow the lines in order and write each variable value.
- Say the final OUTPUT aloud. Then swap roles.
- Change the process line to double = sum * 3 and run it again. Which part changed: input, process or output?
Practice sheet
Check what you learned
Practice sheet: Input, process, output (Classes 6-8, Computers and coding)
- Name the three parts of every computer task, in order.
- Is a keyboard an input device or an output device?
- Is a printer an input device or an output device?
- In the area pseudocode, which line is the process?
- What is pseudocode?
- Run this: INPUT n. result = n * n. OUTPUT result, with n = 7. What is the output?
- For a microwave oven, what is the input, the process and the output?
- Write pseudocode to take a price and output the price with 10 added.
- A program outputs the wrong average. Which part would you check first: the input, the process or the output?
- Why is pseudocode written in simple English words instead of a real language?
Answer key
Answers: Input, process, output
- Input, process, output.
- Input.
- Output.
- area = length * breadth.
- A plan written in simple English-like steps that a person can follow; it is not run by a computer.
- 49
- Input: the food and the time you set. Process: heating. Output: hot food (and the beep).
- INPUT price. newprice = price + 10. OUTPUT newprice.
- The process, because that is where the calculation is done (though checking the input is also sensible).
- So that anyone can read it and it can later be turned into any programming language.
