GCSE · Computer Science · AQA · Spec 8525

Inputs, processing and outputs of algorithms

Something comes in, something gets worked on, something goes out. Spot those three moments and you can read a simple algorithm line by line.

Computer Science · Algorithms

In, worked on, or out?

This algorithm works out what a group pays to get into an event. Take each line in turn. Is data coming IN, being WORKED ON, or going OUT? Make your call first, then read why.

Still to sort

Input: data comes in (0)

A value arrives from outside the algorithm. The user entering a number is one example.

Where the line is: An input line gets its value from outside. If the value is worked out from data that's already inside, the line is processing.

Processing: data is worked on (0)

Data already inside is calculated with, compared or changed.

Where the line is: Processing never brings data in and never sends information out. It only works on what's already there.

Output: information goes out (0)

Information leaves the computer so someone can see or use it.

Where the line is: An output can come anywhere in an algorithm, even on line 1. What matters is the direction (going out), not the position.

6 of 6 still to sort.

Line 6 is ENDIF. It just marks where the IF finishes, so it isn't in the tray.

Exam line: If you're asked where an input happens, point to the exact line (for example, line 2: people ← USERINPUT). "At the start" isn't precise enough.
Watch out: Output isn't always the last line. Line 1 sends a message out before anything has come in, and that still makes it an output.

Computer Science · Algorithms

Trace table — dry run the code

Same algorithm, now with real data. A group of 7 turns up. Step through it and follow the number: what comes in, what's done to it, and what finally comes out?

1OUTPUT 'How many people?'
2people ← USERINPUT
3cost ← people * 8
4IF people > 5 THEN
5 cost ← cost - 10
6ENDIF
7OUTPUT cost
people
cost
Output
Press Start to run the first line.
·

Ready when you are — step through one line at a time.

Computer Science · Algorithms

Where did the answer go?

Priya wrote her own version of the group-ticket algorithm. It should show the cost for every group. For a group of 7 it shows 46, which is right. But a group of 3 gets no cost at all. Which line is in the wrong place?

Priya's algorithm — which line goes wrong?

Exam line: When an algorithm gives the wrong output, or none at all, check where the OUTPUT line sits, not just what it says.

Computer Science · Input and output

Not just keyboard and monitor

So far our data has come in as a number the user enters and gone out as a message. Computers have plenty of other ways in and out. For each one, decide: does it get data IN, send information OUT, or both?

  • A Input: gets data in
  • B Output: sends information out
  1. Keyboard
  2. Mouse
  3. Microphone
  4. Temperature sensor
  5. Monitor
  6. Printer
  7. Speakers
  8. Touchscreen
  9. Headset with a microphone

Exam line: If a question asks for a device other than a keyboard or a monitor, have a few others ready, for both input and output.

Computer Science · Algorithms

Your turn: explain a new algorithm

1 OUTPUT 'Enter your test score' 2 score ← USERINPUT 3 IF score ≥ 40 THEN 4 OUTPUT 'Pass' 5 ELSE 6 OUTPUT 'Resit' 7 ENDIF

Explain this algorithm in terms of its inputs, processing and outputs. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

Exam line: Give one clear point for input, processing and output, each tied to a line number. Each point in the list above is worth a mark on its own.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Read an algorithm the way the computer meets it: what comes in, what gets done to it, what goes out.

What you need to know

  • Input is any way data gets into the computer. A keyboard is one way in, not the only one.
  • Output is any way information gets out. A monitor is one way out, not the only one.
  • Processing is the work done on data that's already inside: calculating, comparing and changing values.
  • Have a goA line reads total ← price * 3. Nobody types anything and nothing appears on screen. Input, processing or output?

    Processing.

    It works on price, which is already inside. The arrow alone doesn't make a line an input: an input's value has to come from outside.

  • An IF line counts as processing too. It compares values to decide what runs next.
  • Judge a line by which way the data moves, not where it sits. Line 1 can be an output.
  • Have a goYour friend is certain: 'OUTPUT "Ready? Here we go!" can't be an output. It's line 1 and nothing has been worked out yet!' Are they right?

    No. It's an output, even on line 1.

    A message is leaving the computer, and that's what makes an output. Your friend is judging by position, which feels sensible but isn't the rule.

  • A message asking the user for something is an output. The input is the line that stores their reply.
  • The computer only handles input and output where the code says, so the programmer must state exactly where and how.
  • Have a goA program works out a shopping bill perfectly, but the programmer never wrote an OUTPUT line. What does the shopper see of the bill?

    Nothing at all.

    The total is worked out but stays inside the computer. It's tempting to think a result appears by itself, but output only happens where the code says.

  • Explaining an algorithm means telling its story: what came in, what was done to it, what went out, and on which lines.

The big picture

Any simple algorithm can be explained in three parts. Inputs are data coming in. Processing is the work done on that data. Outputs are information going out. You should be able to point at the exact line where each one happens. And input and output aren't just a keyboard and a monitor.

Key points

1Lines like people ← USERINPUT are inputs: a value arrives from outside the algorithm.
2Calculations, comparisons (IF) and changes to a variable are processing.
3Lines like OUTPUT cost are outputs, and so are messages that ask the user for something.
4To explain an algorithm, say what data goes in, what is done to it and what information comes out, with a line number for each.
5Input and output devices go well beyond the keyboard and monitor, and a touchscreen does both.

Worked example

Problem

Identify the inputs, processing and outputs in this algorithm, then explain what it does. 1 OUTPUT 'How much do you save each week?' 2 weekly ← USERINPUT 3 OUTPUT 'For how many weeks?' 4 weeks ← USERINPUT 5 saved ← weekly * weeks 6 OUTPUT saved

⚠ Watch out

Calling OUTPUT 'Enter your name' an input because it asks for data. Looks convincing. It isn't: a message is leaving the computer, so it's an output. The input is the next line, which stores what's typed. And input isn't just 'the keyboard', any more than output is just 'the screen'.

🧠

Memory hook

In → Worked on → Out. Point at any line and ask one question: which way is the data moving?

✓

Check yourself

Cover the page. In the group-ticket algorithm, why is line 1 an output when nothing has been worked out yet? Which line is the only input, and which three are processing?

Flashcards

(10)
What is an input?
Any way data gets into the computer. It doesn't have to come from a keyboard.
What is an output?
Any way information gets out of the computer. It doesn't have to go to a monitor.
What counts as processing in an algorithm?
Work done on data already inside: calculating, comparing and changing values.
Is a line like IF people > 5 THEN input, processing or output?
Processing. It compares values that are already inside to decide which lines run next. Nothing comes in and nothing goes out on that line.
How do you decide whether a line is input, processing or output?
Ask which way the data is moving: coming in, being worked on, or going out. The line's position doesn't decide it.
Is OUTPUT 'Enter a number' an input or an output?
An output. It sends a message out to the user. The input is the line that stores what they type.
Why must the programmer specify exactly where output happens?
The computer outputs only where the code says. Put an OUTPUT in the wrong place and the result can be worked out but never shown.
Name a device that is both an input and an output device.
A touchscreen. You tap it to put data in, and it displays information out.
Give three ways a computer can output information.
For example, showing it on a monitor, printing it on paper, or playing it as sound through speakers.
What three things do you say when you explain an algorithm in terms of inputs, processing and outputs?
What data comes in, what is done to it, and what information goes out, with the line where each happens.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 28 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.