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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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
- The purpose and functions of an operating system (memory management, multitasking, peripheral management, the user interface, and security and user management) and the role of common utility software.
An Eduqas GCSE Computer Science answer on the purpose and functions of an operating system (memory management, multitasking, peripheral management, the user interface, security and user management) and the role of common utility software.
- Variables and constants, the common data types (integer, real, Boolean, character, string), and the arithmetic, relational and logical operators used in programs.
An Eduqas GCSE Computer Science answer on variables and constants, the common data types (integer, real, Boolean, character, string), and the arithmetic, relational and logical operators, including integer division and modulus.
- The three programming constructs: sequence, selection (if and nested if) and iteration (count-controlled and condition-controlled loops), and when to use each.
An Eduqas GCSE Computer Science answer on the three programming constructs: sequence, selection (if, else, nested if) and iteration (count-controlled for loops and condition-controlled while loops), with worked pseudocode for each.
- Arrays as a data structure: declaring and using one-dimensional arrays, accessing elements by index, and iterating through an array with a loop, with awareness of two-dimensional arrays.
An Eduqas GCSE Computer Science answer on arrays as a data structure: declaring and using one-dimensional arrays, accessing elements by index, iterating through an array with a loop, and awareness of two-dimensional arrays.
- String handling (length, indexing, substrings, concatenation, case conversion), input validation (presence, range, length, type and format checks), and how programs are written and tested in the Component 2 on-screen exam.
An Eduqas GCSE Computer Science answer on string handling (length, indexing, substrings, concatenation, case conversion), input validation (presence, range, length, type, format), and how programs are written, tested and refined in the Component 2 on-screen exam.
Sources & how we know this
- WJEC Eduqas GCSE Computer Science specification (from 2016) — Eduqas (2020)