Study resource
Programming study guide
Study Programming with curriculum-aligned Study Guide resources, practice links, and exam-focused support.
At a glance
study guide
Resource type
Topic
Programming
Study guide overview
Study Guide: Applying A-level Programming Concepts
Use this guide to connect data representation, operations, control flow and subroutine mechanisms when tracing, designing and explaining programs.
Build a mental model
Start by identifying the data used by a program. Ask whether each value is an integer, float, Boolean, character, string, date/time value, pointer/reference, record or array. Then identify which values can change and which should be named constants. A declaration establishes the intended variable or constant, while an assignment changes a variable's stored value. When designing identifiers, choose names that communicate purpose rather than relying on unexplained short names.
Next trace the three combining principles. In sequence, follow statements in order and update variables after every assignment. In selection, evaluate relational expressions and Boolean operations before choosing a branch. In iteration, record the condition and determine whether it is tested at the start or end. For a definite loop, determine the known number of repetitions. For an indefinite loop, explain what causes the condition eventually to change. When structures are nested, trace the inner structure completely for each relevant execution of the outer structure.
Apply operations precisely
When a question involves division, distinguish real/float division from integer division and identify any remainder operation. Do not treat truncation as rounding. For strings, separate length, position, substring and concatenation: each has a different purpose. Also distinguish a character from its character code, and distinguish a string containing digits from an integer until an explicit conversion occurs. Similar care is needed when converting between strings, integers, floats and date/time values.
For Boolean reasoning, rewrite a condition in words before evaluating it.
ANDrequires both conditions,ORrequires at least one,XORrequires differing Boolean values, andNOTreverses the result. Relational operators include both strict comparisons and inclusive comparisons, soless thanis different fromless than or equal to. Random number generation should be identified as a separate operation rather than assumed to be a fixed value.Explain subroutine mechanisms
When analysing a subroutine, identify its name, parameters, local variables, returned value and calling routine. A parameter is part of the interface through which data is passed. A returned value travels back to the calling routine; a procedure need not return a value. Explain the advantage of a subroutine in terms of a named block that can be called when needed, rather than merely saying that it makes code 'better'.
For scope questions, state exactly where a variable is accessible and when it exists. Local variables exist only while their subroutine executes and are accessible only within that subroutine. Contrast this with a global variable, which is not restricted to one subroutine in the same way. When describing a call, include the stack frame and its required contents: return address, parameters and local variables. Do not confuse a parameter with a local variable: a parameter is data passed through the interface, whereas a local variable is declared by the subroutine.
Recursion and exception handling
For a recursive algorithm, label the base case and general case. The base case returns or completes without another recursive call. The general case performs the smaller or progressed version of the problem, so repeated calls can reach the base case. In a trace, write the values passed on each call and then follow the returns in reverse order. If no base case exists, or the calls do not progress towards it, the recursive technique is not correctly controlled.
Exception handling should be explained as a mechanism for dealing with exceptions in a familiar programming language. Do not describe every unusual input as an exception without identifying the programming mechanism involved.
Self-check questions
- Can you distinguish a variable, a constant, a parameter, a local variable and a global variable?
- Can you explain why a start-tested indefinite loop may execute zero times, while an end-tested loop executes its body before testing?
- Can you trace integer division, a remainder, rounding and truncation without treating them as the same operation?
- Can you explain the difference between a string conversion and string concatenation?
- Can you identify the return address, parameters and local variables stored in a stack frame?
- Can you mark the base and general cases in a recursive subroutine?
- Can you explain how nested selection or nested iteration changes the order in which statements execute?
When answering an exam question, use the terminology requested by the question, show the intermediate reasoning in a trace, and justify distinctions rather than listing isolated definitions.
Ready to practise?
Choose your next step
Use the study guide for understanding, then switch into an active revision mode.
Related topics
