Programming
Programming
Programming is the practical application of computational thinking: translating algorithms into executable code. This section covers the programming constructs, paradigms, and techniques required for A-Level, with a focus on writing clear, correct, and maintainable code.
Topics Covered
Programming Constructs
- Sequence, selection, iteration — the three fundamental control structures
- Conditional statements —
IF...THEN...ELSE,CASE/SWITCH - Loops —
FOR(count-controlled),WHILE(condition-controlled),DO...UNTIL(post-tested) - Nested constructs — combining selection and iteration for complex logic
Data Types and Variables
- Primitive types — integer, real/float, Boolean, character, string
- Constants vs. variables — when to use each
- Casting and type conversion — explicit and implicit
- Scope and lifetime — local vs. global variables, parameter passing
Procedures and Functions
- Parameters — value parameters (pass by value) vs. reference parameters (pass by reference)
- Return values — functions vs. procedures
- Modularity — decomposing programs into reusable subprograms
Object-Oriented Programming
- Classes and objects — blueprints and instances
- Encapsulation — public and private members, getters and setters
- Inheritance — parent and child classes, method overriding
- Polymorphism — method overloading and dynamic dispatch
- Composition vs. inheritance — choosing the right relationship
Data Representation in Programming
- Arrays — 1D and 2D; initialisation, traversal, searching
- Records/structs — grouping related data
- File handling — reading from and writing to text and CSV files
- Validation and verification — range checks, type checks, presence checks, check digits
Study Tips
- Write pseudocode, not just Python — exams accept pseudocode, and writing it trains you to think algorithmically rather than in a specific language’s syntax.
- Trace tables are essential — practise filling in trace tables for programs with loops and conditionals. Every exam has at least one trace-table question.
- Understand OOP concepts by analogy — a class is a blueprint; an object is a house built from it. Inheritance is “is-a”; composition is “has-a.”
- Practise file handling — reading CSV data, processing it, and writing results. This appears frequently in NEA-style questions.
- Dry-run your code before writing it — plan the algorithm, trace it with sample input, then code it.
How to Use These Notes
Follow the sidebar order. Each page provides pseudocode examples, comparison tables, worked traces, and exam-style problems. Start with constructs and data types, then progress to OOP.