How do procedures and the object-oriented features of classes, inheritance and polymorphism structure larger programs?
Procedural and object-oriented programming: subroutines (procedures and functions) with parameters and return values, and the object-oriented concepts of classes and objects, encapsulation, inheritance and polymorphism.
An Eduqas Component 1 answer on programming paradigms: procedures and functions with parameters passed by value or reference, and the object-oriented concepts of classes, objects, encapsulation, inheritance and polymorphism, with their benefits for large 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 dot point is asking
Eduqas wants you to describe subroutines (procedures and functions, parameters, return values, and passing by value or reference) and the object-oriented concepts of classes and objects, encapsulation, inheritance and polymorphism, with their benefits for building and maintaining large programs.
The answer
Subroutines, parameters and return values
Classes, objects and encapsulation
Inheritance and polymorphism
Examples in context
Procedural decomposition into subroutines is how every non-trivial program is organised, and parameter passing is exactly why a sorting routine can work on any array you hand it. OOP underpins most large software: a game models players, enemies and items as objects; a banking system models accounts and transactions. The Eduqas project (Component 3) is usually built in an OOP or modular style, and these concepts connect to the functional paradigm in Component 2, which takes a deliberately different, stateless approach.
Try this
Q1. State one difference between a function and a procedure. [1 mark]
- Cue. A function returns a value (used in an expression); a procedure does not return a value.
Q2. Define encapsulation. [2 marks]
- Cue. Bundling an object's data and methods together, keeping the data private and accessing it only through the object's public methods.
Q3. What does inheritance allow a subclass to do? [1 mark]
- Cue. Reuse (inherit) the attributes and methods of its superclass, and add or override its own.
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 20204 marksExplain the difference between a procedure and a function, and the difference between passing a parameter by value and by reference.Show worked answer →
Procedure versus function (up to 2 marks): a function returns a single value to the calling code and is used in an expression; a procedure carries out a task but does not return a value (it may produce output or change state).
By value versus by reference (up to 2 marks): passing by value sends a copy of the data, so changes inside the subroutine do not affect the original; passing by reference sends the address of the data, so changes inside the subroutine do affect the original variable.
Markers reward the return-value distinction for procedure versus function, and the copy-versus-address distinction for the parameter passing.
Eduqas 20226 marksDescribe the object-oriented concepts of encapsulation, inheritance and polymorphism, giving an example of each in the context of a class `Vehicle` with subclasses `Car` and `Motorbike`.Show worked answer →
Encapsulation (up to 2 marks): bundling data (attributes) and the methods that act on it inside a class, with attributes kept private and accessed through public methods (getters and setters). Example: Vehicle holds a private speed attribute changed only via an accelerate() method.
Inheritance (up to 2 marks): a subclass inherits the attributes and methods of its superclass and may add its own. Example: Car and Motorbike both inherit speed and accelerate() from Vehicle, and Car adds numberOfDoors.
Polymorphism (up to 2 marks): the same method name behaves differently depending on the object's class, often by a subclass overriding a method. Example: a describe() method is overridden so Car and Motorbike each produce their own description.
Markers reward a correct definition and a relevant Vehicle/Car/Motorbike example for each of the three concepts.
Related dot points
- Programming principles: primitive and composite data types, variables and constants, scope and lifetime, and the three programming constructs of sequence, selection and iteration used to build structured programs.
An Eduqas Component 1 answer on programming principles: the primitive data types, variables versus constants, local versus global scope and lifetime, type conversion, and the three programming constructs sequence, selection and iteration.
- Logical operations: the logic gates (AND, OR, NOT, NAND, NOR, XOR) and their truth tables, building and reading truth tables for expressions, the laws of Boolean algebra and De Morgan's laws, and simplifying expressions with Karnaugh maps.
An Eduqas Component 1 answer on logical operations: the six logic gates and their truth tables, building truth tables for expressions, simplifying with the laws of Boolean algebra and De Morgan's laws, and using Karnaugh maps to minimise a Boolean expression.
- Recursion and algorithmic complexity: the base case and recursive case, how recursion uses the call stack, and Big-O notation for the time and space complexity of algorithms (constant, logarithmic, linear, polynomial and exponential).
An Eduqas Component 1 answer on recursion and complexity: the base case and recursive case, how recursion uses the call stack and can cause stack overflow, and Big-O notation for measuring how an algorithm's time and space scale with input size.
- The functional paradigm: functions as first-class values, pure functions and referential transparency, immutability and the avoidance of side effects, the use of recursion instead of iteration, and how functional differs from imperative programming.
An Eduqas Component 2 answer on the functional paradigm: functions as first-class values, pure functions and referential transparency, immutability and avoiding side effects, recursion in place of iteration, and how functional programming differs from the imperative approach.
- Program construction: the features of an integrated development environment (IDE), modular and structured program design, the use of libraries, and writing maintainable code with sensible naming, comments and indentation.
An Eduqas Component 1 answer on program construction: the features of an integrated development environment (editor, debugger, error diagnostics), modular and structured design, using libraries, and the conventions that make code readable and maintainable.
Sources & how we know this
- WJEC Eduqas GCE AS/A Level Computer Science specification (from 2015) — Eduqas (2015)