Skip to main content
WalesComputer ScienceSyllabus dot point

What are subprograms, and why is a modular, structured approach to programming used?

The use of subprograms (procedures and functions) and parameters, and the benefits of a modular, structured approach to programming.

A focused answer to the WJEC GCSE Computer Science Unit 1 content on subprograms and program structure, covering procedures and functions, the use of parameters, the difference between a procedure and a function, and the benefits of a modular, structured approach to writing programs.

Generated by Claude Opus 4.88 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 topic is asking
  2. What a subprogram is
  3. Procedures and functions
  4. Parameters
  5. Benefits of a modular, structured approach
  6. Try this

What this topic is asking

WJEC wants you to know what subprograms (procedures and functions) are, how parameters are used, and the benefits of a modular, structured approach to programming. This is part of the Algorithms and programming principles content in Unit 1 of WJEC GCSE Computer Science (3500).

What a subprogram is

Procedures and functions

Parameters

Benefits of a modular, structured approach

Try this

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

  • Cue. A function returns a value to the calling code; a procedure does not.

Q2. Give one benefit of breaking a program into subprograms. [1 mark]

  • Cue. Any one of: easier to manage, reuse of code, easier to test and debug, easier to read and maintain, or a team can work on different parts.

Exam-style practice questions

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

WJEC-style Unit 13 marksExplain what a subprogram is and the difference between a procedure and a function.
Show worked answer →

A Unit 1 programming question. A subprogram is a named block of code that performs a specific task and can be called (run) whenever it is needed from elsewhere in the program (1 mark). A procedure carries out a task but does not return a value to the part of the program that called it (1 mark). A function carries out a task and returns a value that can be used in the rest of the program, such as a calculation result (1 mark). Markers reward the named-reusable-block idea and the returns-a-value distinction. A common error is to say both always return values, when only a function returns a value.

WJEC-style Unit 14 marksDescribe the benefits of using a modular, structured approach with subprograms when writing a large program.
Show worked answer →

A Unit 1 explain question. Award up to 1 mark for each benefit, to four. Breaking a large program into subprograms (modules) makes the problem easier to manage, because each part is smaller and can be tackled separately (decomposition). It allows reuse: a subprogram can be called many times rather than writing the same code repeatedly, which reduces errors and the amount of code. It makes the program easier to test and debug, because each module can be tested on its own. It also makes the program easier to read and maintain, and lets a team work on different modules at the same time. Markers reward any four distinct benefits. A common error is to repeat the same benefit in different words.

Related dot points

Sources & how we know this