Grade 12 · Practical
Procedures and functions
Programming Fundamentals · about 3 min
Modular design — splitting work into procedures and functions — is expected throughout Paper 1, especially the OOP section.
Key points- Procedure = performs a task; function = returns a value via `Result`.
- Parameters pass data in; `var` parameters let a method change the caller's variable.
- Keep each method short and single-purpose so it is testable and reusable.
- In OOP, methods live inside a class; accessors return attributes, mutators change them, and logic methods classify or calculate.
- Function / procedure — returns a value / performs a task.
- Result — the variable a function assigns to return its value.
EXAM TIP
need a value back? function + Result. Just performing an action? procedure. Name methods by what they do.