GCSE Computer Science Revision — Subroutines
Revise Subroutines for GCSE Computer Science. Step-by-step explanation, worked examples, common mistakes and exam-style practice aligned to AQA, Edexcel, OCR, WJEC, Eduqas, CCEA, Cambridge International (CIE), Pearson Edexcel International, OxfordAQA International, SQA, IB, AP.
At a glance
- What StudyVector is
- An exam-practice platform with board-aligned questions, explanations, and adaptive next steps.
- This topic
- Subroutines in GCSE Computer Science: explanation, examples, and practice links on this page.
- Who it’s for
- Students revising GCSE Computer Science for UK exams.
- Exam boards
- Practice is aligned to major specifications (AQA, Edexcel, OCR, WJEC, Eduqas, CCEA, Cambridge International (CIE), Pearson Edexcel International, OxfordAQA International, SQA, IB, AP).
- Free plan
- Sign up free to use tutor paths and feedback on your answers. Free access is 7 days uncapped, then 45 min revision/day. Pricing
- What makes it different
- Syllabus-shaped practice and progress tracking—not generic AI answers.
Topic has curated content entry with explanation, mistakes, and worked example. [auto-gate:promote; score=70.6]
Next in this topic area
Next step: Arrays & Lists
Continue in the same course — structured practice and explanations on StudyVector.
Go to Arrays & ListsTopic explanation
What is Subroutines?
A subroutine is a named block of code that performs a specific task and can be called from other parts of the program. Using subroutines (also known as functions or procedures) helps to break down a large program into smaller, more manageable, and reusable chunks. This makes the code easier to read, test, and debug, following the DRY (Don't Repeat Yourself) principle.
Board notes: A fundamental concept for AQA, Edexcel, and OCR. You will be expected to write your own subroutines (both functions and procedures) and understand the concepts of parameters, arguments, and local variables.
Step-by-step explanationWorked examples
Worked example 1: Core method
A function to add two numbers in Python: `def add_numbers(num1, num2): return num1 + num2`. Here, `num1` and `num2` are parameters. You can call this from your main program like this: `sum_result = add_numbers(5, 10)`. The `sum_result` variable will now hold the value 15.
Worked example 2: Exam variation
Now change one detail in the question and keep the same structure: name the Subroutines idea being tested, show the method or evidence, then explain why it answers the command word. This helps GCSE Computer Science students avoid memorising one surface pattern.
Worked example 3: Mark-scheme check
Finish by checking the answer against marks: one point for the correct Subroutines idea, one for accurate working or evidence, and one for a precise final statement. If any step is vague, rewrite it before moving to timed practice.
Mini lesson for Subroutines
1. Understand the core idea
A subroutine is a named block of code that performs a specific task and can be called from other parts of the program. Using subroutines (also known as functions or procedures) helps to break down a large program into smaller, more manageable, and reusable chunks.
Can you explain Subroutines without copying the notes?
2. Turn it into marks
A function to add two numbers in Python: `def add_numbers(num1, num2): return num1 + num2`. Here, `num1` and `num2` are parameters.
Underline the method, evidence, or command-word move that would earn credit in GCSE Programming.
3. Fix the likely mark leak
Watch for this mistake: Confusing functions and procedures. A function returns a value (e.g., a calculation result), while a procedure just performs a task (e.g., printing to the screen).
Write one correction rule before doing another practice question.
Practise this topic
Start with low-focus cards for Subroutines, then move into full exam-style practice when you want the heavier session.
Mini quiz: Subroutines
Three quick checks for revision practice. They are original StudyVector prompts, not official exam-board questions.
Question 1
In one GCSE sentence, explain what Subroutines is testing.
Answer: A subroutine is a named block of code that performs a specific task and can be called from other parts of the program. Using subroutines (also known as functions or procedures) helps to break down a large program into smaller, more manageable, and reusable chunks.
Mark focus: Precise definition and topic focus.
Question 2
A student is revising Subroutines. What should they do after reading the notes?
Answer: A function to add two numbers in Python: `def add_numbers(num1, num2): return num1 + num2`. Here, `num1` and `num2` are parameters.
Mark focus: Method selection and command-word control.
Question 3
A student makes this mistake: "Confusing functions and procedures. A function returns a value (e.g., a calculation result), while a procedure just performs a task (e.g., printing to the screen)." What should their next repair task be?
Answer: Do one Subroutines question and review the mistake type.
Mark focus: Error correction and next-step practice.
Subroutines flashcards
Core idea
What is the main idea in Subroutines?
A subroutine is a named block of code that performs a specific task and can be called from other parts of the program. Using subroutines (also known as functions or procedures) helps to break down a large program into...
Common mistake
What mistake should you avoid in Subroutines?
Confusing functions and procedures. A function returns a value (e.
Practice
What is one useful practice task for Subroutines?
Answer one Subroutines question and review the mistake type.
Exam board
How should you use board notes for Subroutines?
A fundamental concept for AQA, Edexcel, and OCR. You will be expected to write your own subroutines (both functions and procedures) and understand the concepts of parameters, arguments, and local variables.
Common mistakes
- 1Confusing functions and procedures. A function returns a value (e.g., a calculation result), while a procedure just performs a task (e.g., printing to the screen).
- 2Getting the scope of variables wrong. Variables defined inside a subroutine are local and can only be used within it, whereas global variables can be accessed from anywhere but are generally bad practice.
- 3Forgetting to call the subroutine. Just defining a subroutine doesn't make it run; you have to explicitly call it by its name in your main program.
Subroutines exam questions
Exam-style questions for Subroutines with mark-scheme style solutions and timing practice. Aligned to AQA, Edexcel, OCR, WJEC, Eduqas, CCEA, Cambridge International (CIE), Pearson Edexcel International, OxfordAQA International, SQA, IB, AP specifications.
Subroutines exam questionsGet help with Subroutines
Get a personalised explanation for Subroutines from the StudyVector tutor. Ask follow-up questions and work through problems with step-by-step support.
Open tutorFree full access to Subroutines
Sign up in 30 seconds to unlock step-by-step explanations, low-focus question cards, instant feedback and Play routes — completely free, no card required.
Try one low-focus question
Unlock Subroutines low-focus cards
Get instant feedback, step-by-step help and a calmer first run — free, no card needed.
Start free low-focus cardsAlready have an account? Log in
Step-by-step method
Step-by-step explanation
4 steps · Worked method for Subroutines
Core concept
A subroutine is a named block of code that performs a specific task and can be called from other parts of the program. Using subroutines (also known as functions or procedures) helps to break down a l…
Frequently asked questions
What are parameters and arguments in a subroutine?
Parameters are the variables listed in the subroutine's definition that act as placeholders for the data it will receive. Arguments are the actual values that are passed into the subroutine when it is called.
Why is using subroutines good programming practice?
Subroutines make code more modular and reusable. They reduce code duplication, make the program easier to understand and debug, and allow programmers to work on different parts of a program independently.