Revision Notes
A Level Computer Science: Fundamentals of Programming — Revision Notes
Condensed recall notes on data types, constructs, arrays, subroutines, OOP and testing for AQA A Level Computer Science 7517.
- Subject
- Computer Science
- Level
- A LEVELS
- Topic
- Fundamentals of programming
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to AQA A Level Computer Science (7517), 2015-onwards. Official specification .
Syllabus page (what it covers and how it is assessed): AQA A Level Computer Science.
Syllabus points this page covers
7517
- 1 Fundamentals of programming (whole topic)
Found an error? Report a correction.
Need help with this topic? Request a free trial class for A Level Computer Science (7517).
Condensed for the final weeks. For the full explanation, use the Fundamentals of Programming study guide.
Data types
| Type | Holds |
|---|---|
| Integer | Whole numbers |
| Real / float | Numbers with a fractional part |
| Boolean | True / False |
| Character | One character |
| String | A sequence of characters |
| Date/time, pointer/reference, records | Composite and system types |
A phone number is a string. It may lead with zero, is never used in arithmetic, and may contain + or spaces.
Variable — value can change. Constant — fixed at design time, which makes the code readable and confines a change such as a tax rate to one line.
Constructs and operators
Sequence, selection (IF, CASE), iteration (FOR count-controlled, WHILE condition tested before, REPEAT UNTIL condition tested after, so it always runs at least once).
DIV integer division 17 DIV 5 = 3
MOD remainder 17 MOD 5 = 2
n MOD 2 = 0 tests for even. MOD is also the basis of hashing and of check-digit algorithms.
Subroutines
Procedure returns nothing; function returns a value.
- Parameters are in the definition; arguments are what you pass.
- By value — a copy is passed, so the original is unchanged.
- By reference — the memory address is passed, so changes affect the original.
- Local variables exist only within the subroutine; global are visible throughout.
Prefer local variables and pass by value where possible, because it prevents unintended side effects — one subroutine changing data another depends on. That reasoning is what the mark scheme wants, not just the definitions.
Recursion
A subroutine that calls itself. It must have a base case that stops the recursion, and each call must move towards it. Without a base case the call stack overflows.
factorial(n):
IF n = 0 THEN RETURN 1 <- base case
ELSE RETURN n * factorial(n-1) <- general case
Recursion is elegant and natural for tree traversal, but uses more memory than iteration because every unfinished call remains on the stack.
Object-oriented programming
| Concept | Meaning |
|---|---|
| Class | A template defining attributes and methods |
| Object | An instance of a class |
| Encapsulation | Attributes private, accessed through public methods |
| Inheritance | A subclass acquires the attributes and methods of its superclass |
| Polymorphism | The same method name behaves differently depending on the object |
| Overriding | A subclass replaces an inherited method |
Encapsulation exists to protect data integrity. Making attributes private and forcing access through get and set methods means validation can be enforced in one place and internal representation can change without breaking other code. Answers that define it without giving that reason lose the explanation mark.
Composition (“has-a”) versus inheritance (“is-a”) — a car has an engine; a car is a vehicle. Choosing inheritance where composition is meant produces fragile hierarchies.
Data structures
- Array — fixed size, same type, indexed, contiguous.
- Record — fields of different types, one entity.
- Stack — LIFO. push, pop, peek. Used for call stacks and undo.
- Queue — FIFO. enqueue, dequeue. Used for print spooling and scheduling.
- Linked list — nodes with pointers; easy insertion and deletion, but no direct indexing.
- Tree — hierarchical; a binary search tree gives O(log n) search when balanced.
- Hash table — key mapped to index by a hash function; near O(1) lookup, with collisions handled by chaining or probing.
Testing
| Test data | Purpose |
|---|---|
| Normal | Should be accepted |
| Boundary | On and just beyond the limits |
| Erroneous | Should be rejected |
Boundary data catches the off-by-one errors that are the most common bug. For a range of 1–100, test 0, 1, 100 and 101 — testing only 1 and 100 is insufficient.
Errors: syntax (will not run), logic (runs, wrong output, hardest to find), runtime (fails during execution).
Testing strategies: white box (tests the internal logic and all paths), black box (tests inputs against expected outputs without knowledge of the code), alpha, beta, and regression testing after changes.
Exam traps
- Storing a phone number as an integer.
- Saying WHILE always executes at least once.
- Omitting the base case when explaining recursion.
- Defining encapsulation without explaining that it protects data integrity.
- Confusing a stack with a queue.
- Giving only normal test data.
- Using inheritance where composition is correct.
Self-test
- Distinguish passing by value from passing by reference, and say which is safer.
- What two things must a recursive subroutine have?
- Why is encapsulation used?
- Distinguish a stack from a queue, with a use for each.
- Give boundary test data for a value that must be between 1 and 100.
Answers: 1. By value passes a copy so the original is unchanged; by reference passes the memory address so the original can be modified. By value is safer because it avoids unintended side effects. 2. A base case that terminates the recursion, and a general case that moves towards it. 3. To protect data integrity — attributes are private and accessed only through methods, so validation is enforced in one place and the internal representation can change without breaking other code. 4. A stack is LIFO, used for call stacks and undo; a queue is FIFO, used for print spooling and scheduling. 5. 0, 1, 100 and 101.
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.
Related resources
-
Study guides
AQA A-Level Computer Science: Fundamentals of Programming (7517)
Topic 1 Fundamentals of programming (4.1) for AQA A-Level Computer Science (7517): data types, programming concepts and operations, exception handling, subroutines, stack frames and recursion (4.1.1), and the procedural-oriented and object-oriented paradigms, including class diagrams (4.1.2).
Computer Science · AQA · A Level
Read guide -
Practice questions
A Level Computer Science: Fundamentals of Programming — Practice Questions
Original exam-style practice questions with full worked answers on data types, control structures, procedures, functions and scope.
Computer Science · AQA · A Level
Try questions -
Study guides
AQA A-Level Computer Science: Data Structures and Arrays (7517)
The concept of a data structure, and the use of single- and multi-dimensional arrays to solve simple problems – 4.2.1.1 and 4.2.1.2 of AQA A-Level Computer Science (7517).
Computer Science · AQA · A Level
Read guide
Related articles
-
teaching
A Level tuition in Dubai: Cambridge or Pearson Edexcel International A Level?
Schools in Dubai and Abu Dhabi teach either Cambridge International AS & A Level or Pearson Edexcel International A Level. How the two are structured, why it matters for tuition, and how online classes from Lahore work.
9 October 2026
-
curriculum guides
Choosing subjects at IGCSE and A Level
How subject choices at 14 and 16 affect university options later, and how to keep pathways open without overloading a timetable.
28 July 2026
Studying this with a teacher
Working through Computer Science A LEVELS?
This page is free and stays free. If you would rather be taught it, Marlbridge runs Computer Science classes one-to-one and in small groups of up to 15, online in your own time zone. The first trial class is free. WhatsApp replies within an hour (8am–11pm Pakistan time, every day); email the same day.
AQA Computer Science teachers at Marlbridge