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.
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 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
- The three programming constructs (sequence, selection and iteration), the use of variables and constants, and arithmetic, relational and logical operators.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on programming constructs, covering sequence, selection and iteration (including IF statements and FOR and WHILE loops), the difference between variables and constants, and arithmetic, relational and logical operators with worked examples.
- Computational thinking through decomposition and abstraction, what an algorithm is, and expressing algorithms using flowcharts and pseudocode.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on computational thinking and algorithms, covering decomposition and abstraction, what an algorithm is, and how algorithms are expressed using flowcharts (with the standard symbols) and pseudocode, with worked examples.
- The stages of the software development life cycle (analysis, design, development, testing, evaluation and maintenance) and the use of test plans and test data.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on the software development life cycle, covering the stages of analysis, design, development, testing, evaluation and maintenance, the purpose of each stage, and the use of test plans and test data including normal, boundary and erroneous data.
- Low-level and high-level programming languages, the need for translators, and the differences between assemblers, compilers and interpreters.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on programming languages and translators, covering low-level (machine code and assembly) and high-level languages, why translators are needed, and the differences between assemblers, compilers and interpreters with their advantages and disadvantages.
- The linear search and binary search algorithms, how each works, and the conditions under which each is suitable.
A focused answer to the WJEC GCSE Computer Science Unit 1 content on searching algorithms, covering how the linear search and binary search work step by step, the requirement that binary search needs sorted data, and the relative efficiency of the two methods with worked examples.