Skip to topic
    ← Back to course topics

    Constructs — Edexcel GCSE Computer Science

    Verified courseTeaching note checked against the official specification.

    Constructs explained

    Constructs covers 2 specification points, including Understand the function of and be able to… and Be able to write programs that make….

    Read the full explanation

    Open a point below for its explanation and revision guidance.

    6.2.1 understand the function of and be able to identify the structural components of programs (constants, variables, initialisation and assignment statements, command sequences, selection, repetition, iteration, data structures, subprograms, parameters, input/output)

    Programs are built from recognisable structural components, and you must both explain what each does and spot it in a given program. A constant holds a value fixed at design time, such as a maximum size, while a variable holds a value that can change while the program runs. Initialisation gives a variable its first value; assignment later replaces that value. Command sequence means statements carried out in order, one after another. Selection chooses between paths, usually with if or case. Repetition and iteration both describe looping, where a block runs more than once, either a set number of times or until a condition changes. Data structures organise related values, for example a list or record. Subprograms are named blocks that perform a task and can be called; parameters pass values into them. Input brings data in and output sends results out.

    6.2.2 be able to write programs that make appropriate use of sequencing, selection, repetition (count-controlled, condition-controlled), iteration (over every item in a data structure) and single entry/exit points from code blocks and subprograms

    This criterion asks you to write working programs, not to describe constructs in the abstract. Sequencing means statements execute in the order written, so a program that reads a price, applies a discount and then prints the total must place those steps correctly. Selection uses if, elif and else to choose a branch from a condition. Repetition is count-controlled when a counter fixes the number of passes, for example a for loop running ten times, and condition-controlled when a while loop repeats until a test changes. Iteration over every item in a data structure means visiting each element of a string, list or array in turn, typically with a for-each style loop. Single entry and single exit means each code block or subprogram is reached at one point and left at one point, avoiding jumps into the middle of a loop or multiple scattered returns that make flow hard to trace.

    Read the Constructs study guideFull revision notes for Edexcel GCSE Computer Science

    Your focus

    1. Explain the function of each structural component of a program.
    2. Identify constants, variables, initialisation, assignment, sequence, selection, repetition, iteration, data structures, subprograms, parameters and input/output in given code.
    3. Match a described component to the correct definition in a multiple-choice question.
    Show all 6 objectives
    1. Write a program that combines sequencing, selection and repetition to solve a stated problem.
    2. Select an appropriate count-controlled or condition-controlled loop for a given task and justify the choice.
    3. Structure code blocks and subprograms so each has a single entry point and a single exit point.

    Constructs exam tips

    Marking Points
    • Constant: a value fixed when the program is written and not changed while it runs.
    • Variable: a named store whose value can change during execution.
    • Initialisation: giving a variable its first value; assignment: replacing the stored value later.
    • Command sequence: statements executed in the written order.
    • Selection: choosing between alternative paths, for example with if or case.
    • Repetition and iteration: repeating a block of statements, either a set number of times or until a condition is met.
    • Data structures: organised collections of related values such as lists or records.
    • Subprograms and parameters: named reusable blocks and the values passed into them.
    • Input/output: data entering the program and results being sent out.
    • Sequencing: statements are ordered so that inputs are collected before they are processed and results are output only after calculation.
    • Selection: if, elif and else branches are used with correct conditions and indentation so exactly one intended path runs.
    • Count-controlled repetition: a for loop or equivalent repeats a known number of times, with the counter initialised and updated correctly.
    • Condition-controlled repetition: a while loop repeats while a test remains true, and the test variable is changed inside the loop so it can terminate.
    • Iteration over a data structure: every item in a string, list or array is visited, for example totalling each mark in a list.
    • Single entry and single exit: each block or subprogram is entered once and left once, with no jumps into the middle of a loop and no confusing multiple exit points.
    • Combining constructs: the program nests selection inside repetition or repetition inside selection correctly and still produces the expected output.
    • Testing and refinement: the candidate runs the program with sample data, identifies a fault such as an infinite loop, and corrects it.
    • Explanation: the candidate justifies why a count-controlled loop suits a fixed number of items and a condition-controlled loop suits an unknown number of attempts.
    Examiner Tips
    • 💡Read the code first and name the component you can actually see before checking the options.
    • 💡Eliminate options that describe a different component, such as a definition of selection when the code shows a loop.
    • 💡Check whether a value is ever changed after it is set; if not, it is likely a constant.
    • 💡Plan the program on paper first: list the inputs, the processing steps and the outputs, then map each step to sequencing, selection or repetition.
    • 💡Annotate your code with short comments naming the construct used, such as count-controlled loop, so the assessor can see your intention.
    • 💡Trace your code by hand with one small example, writing the value of each variable after every pass, to prove the loop terminates and the output is correct.
    Common Mistakes
    • Treating a constant as a variable: a constant is fixed at design time, whereas a variable can be reassigned while the program runs.
    • Confusing initialisation with assignment: initialisation sets the first value, while assignment can replace a value at any later point.
    • Thinking repetition and iteration are unrelated ideas: both refer to looping, where a block of statements runs more than once.
    • Mixing up parameters with input: parameters pass values into a subprogram, while input brings data into the program from outside.
    • Writing a while loop whose condition never becomes false, so the program never terminates. Correction: update the controlling variable inside the loop body, for example increment a counter or change a flag.
    • Placing a return statement inside a loop so the subprogram exits after the first item instead of processing every item. Correction: accumulate the result in a variable and return once after the loop, giving a single exit.
    • Using a for loop to repeat an unknown number of times, such as asking for a password until it is correct. Correction: use a condition-controlled while loop for an unknown number of repetitions.
    • Forgetting that indentation defines the block in Python-style code, so a statement that should be inside the loop sits outside it. Correction: indent every statement that must repeat to the same level.