Parameters and Return Values
Revise Parameters and Return Values for GCSE Computer Science with this free worksheet and full mark scheme — Foundation and Higher exam-style questions with worked answers for AQA GCSE Computer Science (8525). Parameters pass data into a subroutine, and a return value passes a result back out.
Free downloads
These worksheets and mark schemes are original, written for Virtus Academy and checked against the current AQA specification. Every worksheet comes with a full mark scheme.
Topic overview
Parameters allow data to be passed into a subroutine, and return values allow data to be passed back out.
A parameter is the variable named in the subroutine definition. An argument is the actual value supplied when the subroutine is called. Defining area(width, height) declares two parameters; calling area(5, 3) supplies two arguments.
Parameters make subroutines reusable. A subroutine that always calculated the area of a 5 by 3 rectangle would be useless; one that takes width and height works for any rectangle. Functions return a value using a RETURN statement, and that value can then be stored in a variable or used directly in an expression.
Revision notes
Parameters and arguments
A parameter is the variable named in the subroutine definition.
An argument is the actual value passed when it is called. area(width, height) has two parameters; area(5, 3) passes two arguments. The terms are distinct and both are examinable.
Why parameters matter
They make a subroutine reusable with different data.
Without parameters a subroutine could only ever work on fixed values. With them, one subroutine handles every case, which is the whole point of writing it separately.
Return values
A function uses RETURN to send a value back to the calling code.
The returned value can be stored — total ← area(5, 3) — or used directly inside a larger expression. A procedure has no RETURN because it sends nothing back.
Key points
- Parameters pass data into a subroutine.
- A parameter is named in the definition.
- An argument is the value passed when calling.
- Parameters make subroutines reusable.
- RETURN sends a value back.
- A returned value can be stored or used directly.
Worked examples
Example 1
State the difference between a parameter and an argument. [2 marks]
Working
Example 2
Explain why parameters make a subroutine more useful. [2 marks]
Working
Example 3
A function called area takes width and height and returns their product. Write the call that stores the area of a 6 by 4 rectangle. [2 marks]
Working
Common mistakes
Using parameter and argument interchangeably.
Parameter is in the definition; argument is in the call.
Passing arguments in the wrong order.
They match the parameters positionally.
Expecting a procedure to return a value.
Only functions have RETURN.
Forgetting to store the returned value.
Calling a function without using its result discards it.
Exam tips
- Keep parameter and argument clearly distinct.
- Match arguments to parameters in order.
- Use RETURN only in functions.
- Assign or use the returned value.
Key terms
- Parameter
- A variable named in a subroutine definition.
- Argument
- The actual value passed when calling.
- Return value
- The value a function sends back.
- RETURN
- The keyword sending a value back from a function.
Related topics
Written and reviewed against the current AQA specification. Spotted an error? Let us know.