Skip to main content
EnglandComputer Science

AQA A-Level Computer Science 4.1 Fundamentals of programming: a complete overview of data types, constructs, subroutines and OOP

A deep-dive AQA A-Level Computer Science guide to 4.1 Fundamentals of programming. Covers the built-in and composite data types, the three basic constructs, arithmetic and logical operations, subroutines, parameters, scope and recursion, and the principles of object-oriented programming.

Generated by Claude Opus 4.818 min read4.1

Reviewed by: AI editorial process; not yet individually human-reviewed

Jump to a section
  1. What 4.1 actually demands
  2. Data types
  3. The three basic constructs
  4. Arithmetic and logical operations
  5. Subroutines, scope and recursion
  6. Object-oriented programming
  7. Check your knowledge

What 4.1 actually demands

Fundamentals of programming is where the whole qualification begins. AQA expects you not only to recall definitions but to read, amend and write working code, because Paper 1 is an on-screen programming exam. This module gives you the building blocks: the data you store, the constructs that control flow, the operators that compute, the subroutines that structure a program, and the object-oriented ideas that organise large systems.

This guide walks through the five topics and how they connect. Each has a matching dot-point page with practice questions.

Data types

Programs store data using built-in data types: integer, real or float, Boolean, character and string. Each maps to a pattern of bits in memory, an integer in two's complement, a real in floating point, a character via a code such as ASCII. Composite types (records and arrays) and user-defined types are built by combining these primitives. Choosing the correct type saves memory and lets the type system catch mistakes.

The three basic constructs

Every imperative program is built from sequence, selection and iteration. Selection (IF, CASE) chooses a path; iteration repeats a block. Definite iteration (FOR) repeats a known number of times; indefinite iteration (WHILE, REPEAT UNTIL) repeats until a condition is met. Constructs can be nested, and a constant is a fixed named value while a variable can change.

Arithmetic and logical operations

Beyond the usual arithmetic, you must know integer division (DIV) and modulus (MOD), the relational operators that give a Boolean result, and the Boolean operators AND, OR and NOT. Operator precedence decides the order of evaluation, so 2+3×4=142 + 3 \times 4 = 14.

Subroutines, scope and recursion

A subroutine is a named block of code. A procedure performs a task; a function returns a value. Data passes in through parameters and out through a return value. A local variable is visible only inside its subroutine; a global variable is visible everywhere, and locals are preferred to avoid side effects. Recursion is a subroutine calling itself with a base case and a general case, using the call stack.

Object-oriented programming

OOP organises a program around objects, instances of classes that hold attributes and methods. Encapsulation bundles data with its methods and hides the data; inheritance lets a subclass derive from a superclass; polymorphism lets the same method call behave differently for different classes.

Check your knowledge

  1. State the most appropriate data type for storing a person's age. (1 mark)
  2. State the difference between definite and indefinite iteration. (2 marks)
  3. Evaluate 17 DIV 417 \text{ DIV } 4 and 17 MOD 417 \text{ MOD } 4. (2 marks)
  4. State the difference between a procedure and a function. (2 marks)
  5. State the two parts every recursive subroutine must have. (2 marks)
  6. Explain the difference between a class and an object. (2 marks)
  7. Explain why local variables are preferred to global variables. (2 marks)
  8. State what polymorphism allows. (2 marks)

Sources & how we know this

  • computer-science
  • a-level-aqa
  • aqa-computer-science
  • fundamentals-of-programming
  • a-level
  • data-types
  • subroutines
  • oop
  • iteration