Skip to main content
EnglandComputer ScienceSyllabus dot point

What is a subprogram, and what is the difference between a procedure and a function?

Subprograms (procedures and functions), the difference between them, parameters and arguments, local and global variables, and why subprograms make programs easier to write and maintain.

An Eduqas GCSE Computer Science answer on subprograms: the difference between a procedure and a function, parameters and arguments, local and global variables, and why subprograms support decomposition, reuse and easier maintenance.

Generated by Claude Opus 4.810 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. What a subprogram is
  3. Procedures and functions
  4. Parameters and arguments
  5. Local and global variables
  6. Try this

What this dot point is asking

Eduqas wants you to explain what a subprogram is, the difference between a procedure and a function, what parameters and arguments are, the idea of local and global variables, and why subprograms make programs easier to write, reuse and maintain. The procedure-versus-function distinction and the reasons for using subprograms are recurring marks.

What a subprogram is

Procedures and functions

Parameters and arguments

Local and global variables

Try this

Q1. State the difference between a procedure and a function. [1 mark]

  • Cue. A function returns a single value; a procedure carries out a task but does not return a value.

Q2. State what a parameter is. [1 mark]

  • Cue. A value passed into a subprogram, named in its definition, that the subprogram uses.

Q3. Give one reason subprograms make a large program easier to write. [1 mark]

  • Cue. They allow decomposition (or reuse, or easier maintenance): the problem is split into smaller parts that can be written and tested separately.

Exam-style practice questions

Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Eduqas Component 1, 20224 marksExplain the difference between a procedure and a function, and state what is meant by a parameter.
Show worked answer →

Procedure versus function (up to 3 marks): both are named blocks of code (subprograms) that can be called from elsewhere; a function returns a single value to the part of the program that called it, while a procedure carries out a task but does not return a value.

Parameter (1 mark): a value passed into a subprogram when it is called, listed in the subprogram's definition, that the subprogram uses (the actual value passed in is the argument).

Markers reward "function returns a value, procedure does not" and "a parameter is a value passed in". Saying a function "does a task" without the return point is incomplete.

Eduqas Component 1, 20234 marksGive two reasons why using subprograms is good practice when writing a large program.
Show worked answer →

Award up to two marks each for two reasons with brief explanation.

Decomposition: a large problem is broken into smaller named parts, each easier to write, understand and test on its own.

Reuse: a subprogram can be called many times from different places, so the code is written once and not repeated, reducing errors and length.

Also valid: easier maintenance (a change is made in one place); allows different programmers to work on different subprograms. Markers reward two genuine reasons, not the same point twice.

Related dot points

Sources & how we know this