Topic module

Subprograms, Modularity and Interfaces

Structuring solutions into procedures or functions with clear parameters, return values, scope and documented interfaces.

Long-form learning
Concept to Risk to Memory to Check-up

How to study for GCSE Computer Science

Move repeatedly between problem, algorithm, trace, code, test evidence and system explanation; use the exact language and assessment format required by your current board.

Core concepts

Concept 1

Modular programs divide responsibilities among cohesive subprograms that can be developed, tested and reused.

Exam cue: Give each subprogram one clear responsibility and a descriptive interface.

Concept 2

Parameters pass values into a subprogram and return values communicate results through a defined interface.

Exam cue: Distinguish an argument supplied by a caller from the parameter receiving it.

Concept 3

Local scope reduces unintended coupling, while global state can make behaviour harder to reason about and test.

Exam cue: Trace local and global variables separately when names overlap.

Risk pitfalls and guardrails

Creating a subprogram that depends on undocumented global variables.

Guardrail: Do not substitute one board's syntax, protocol list, language version or extension topic for the multi-board core; check the current specification and exam year.

Printing a value when the calling code needs it returned.

Guardrail: Do not substitute one board's syntax, protocol list, language version or extension topic for the multi-board core; check the current specification and exam year.

Assuming a local variable remains available after the subprogram ends.

Guardrail: Do not substitute one board's syntax, protocol list, language version or extension topic for the multi-board core; check the current specification and exam year.

Memory anchors

Subprogram

A named reusable block that performs a defined task.

Procedure

A subprogram primarily called to perform actions.

Function

A subprogram that returns a value to its caller.

Parameter

A named input in a subprogram definition.

Scope

The region of a program in which a name is accessible.

Checkpoint rule

Do the check-up only after you can summarize each concept in one sentence and identify one dangerous pitfall from memory.

Knowledge Check (after reading)

Short check-up to confirm understanding of this module.

Check-up Questions

1-2 question checkpoint

What is a subprogram?

In the definition FUNCTION area(width, height), what is each named input called?

Answer all questions to submit.

Next step personalized recommendations

What is Pass Harbor?

Completely free exam prep for 247 UK exams.

  • Practice questions
  • Flashcards
  • Study guides
  • Mock exams
  • No registration
  • No paywall
  • Start instantly
No more expensive exam prep. Quality study tools should be accessible to everyone.