GCSE · Computer Science · AQA · Spec 8525
Parameters
Your average subroutine can average 4, 10 and 7. Now make it average 13, 10 and 7 without touching a line inside it. That's what parameters do. Watch.
Computer Science · Subroutines
Three values in, one average out
Step through both calls and watch where each value goes.
Before you step: when average is called the first time, which value will C hold?
1 SUBROUTINE average(A, B, C)2 total ← A + B + C3 OUTPUT total / 34 ENDSUBROUTINE5 num1 ← 46 num2 ← 107 num3 ← 78 average(num1, num2, num3)9 num1 ← 1310 average(num1, num2, num3)
Variables
Output
Step 1: The definition. A, B and C are declared as parameters: three named slots, waiting for values. Nothing runs yet.
Watch the variable panel. A, B and C only appear once the call has handed them their values.
Why parameters exist
Reason it through
Why does a subroutine need parameters at all?
First link · your turn
Picture average with 4, 10 and 7 typed straight into its body. What happens every time you call it?
Predict, then check
Think about what actually gets handed over at the call.
SUBROUTINE show(a, b) is called as show(num1, num2). Just before the call, num1 holds 6 and num2 holds 9. Inside show, what does b hold?
AQA GCSE Computer Science (8525) §3.2.10: examinable material uses the word 'parameter' for both the names in the definition and the values in the call, so 'parameter' is always safe in an answer. 'Argument' is just the more precise word for the call side.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
How a subroutine gets handed the values it needs, and why the names don't have to match.
What you need to know
- Parameters are declared in a subroutine's definition, so it can receive values from the code that calls it.
- A subroutine's parameters set out what data has to be handed to it every time it's called.
- Calling a subroutine hands control to it, plus any arguments: the values written inside the call's brackets.
Have a goLook at the call total(x, y). Which parts are the arguments, and which part is just the subroutine's name?
x and y are the arguments; total is the name.
Arguments are the values written inside the call's brackets. The name outside the brackets says which subroutine to hand control to.
- At the moment of the call, each argument's value is passed across into a parameter.
- Inside the subroutine, each parameter behaves like a local variable holding the value it was given.
Have a goSUBROUTINE double(n) is called as double(score) while score holds 8. Inside double, what does n hold?
8
The value in score is passed into n at the call. n holds that number like a local variable, not the word 'score'.
- A subroutine can have no parameters, one parameter, or several.
- Argument names don't have to match parameter names: average(num1, num2, num3) works fine with parameters A, B and C.
- What does have to match is the count: the call supplies exactly as many arguments as there are parameters.
Have a goYour mate swears average(x, y) will work for SUBROUTINE average(A, B, C), 'because names don't matter anyway'. They're half right. Which half is wrong?
The count: three parameters need three arguments, and this call gives two.
Names really can differ, but that rule says nothing about how many. The call must still supply exactly as many arguments as there are parameters.
- You'll often see 'parameter' used for the call's values too. That's fine; 'argument' is just more precise.
The big picture
Parameters are declared in a subroutine's definition so it can receive values from the code that calls it. A call hands over control plus its arguments; at that moment each argument's value is passed into a parameter, which then behaves like a local variable. The names can differ, but the call must supply exactly as many arguments as there are parameters.
Key points
Worked example
Problem
SUBROUTINE rectangle(width, height) has the body OUTPUT width * height. The main program sets plot_length ← 7 and plot_width ← 3, then runs rectangle(plot_length, plot_width). Check that the call is valid, say what width and height hold, and state what is output.
⚠ Watch out
Thinking the arguments in a call must share the parameters' names. They don't: average(num1, num2, num3) fills A, B and C perfectly well. What has to match is the count, so average(num1, num2) is wrong, and the names were never the problem.
Memory hook
Different names, same count. The names can be anything; the number can't.
Check yourself
Cover the page. Say where parameters are declared, what happens to each argument's value at the moment of the call, and the one thing about its arguments every call has to get right.
Flashcards
(12)Where are a subroutine's parameters declared?
What do parameters allow a subroutine to do?
What does a subroutine's parameter list tell someone who wants to call it?
What two things does calling a subroutine hand over?
What is an argument?
When are the arguments' values passed into the parameters?
How does a parameter behave inside its subroutine?
How many parameters can a subroutine have?
Must argument names match parameter names?
SUBROUTINE average(A, B, C): how many arguments must a call supply?
Parameters a and b; call made with num1 and num2. What lands in a and b?
Is it wrong to call a value in a call a 'parameter'?
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 postedMore AQA GCSE Computer Science topics
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 31 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.