Pearson Edexcel · GCSE · Computer Science

    Course version: 1CP2 · Version from Sept 2020

    Understand the function of and be able to identify the structural…

    Full specification wording

    Constructs: 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.

    Checked against the Pearson Edexcel 1CP2 specification (opens in a new tab) on .

    • 4 key terms

    Study notes

    From the checked teaching notes for this specification point.

    The idea

    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.

    What earns the marks

    • 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.

    Common mistakes and how to put them right

    • Treating a constant as a variable.

      Put it right: A constant is fixed at design time, whereas a variable can be reassigned while the program runs.

    • Confusing initialisation with assignment.

      Put it right: Initialisation sets the first value, while assignment can replace a value at any later point.

    • Thinking repetition and iteration are unrelated ideas.

      Put it right: Both refer to looping, where a block of statements runs more than once.

    • Mixing up parameters with input.

      Put it right: Parameters pass values into a subprogram, while input brings data into the program from outside.

    Exam 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.

    Try the lesson

    The start of the Constructs: 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) lesson, made from checked teaching notes for this specification point.

    Have a go first

    The program below is run. What is the function of the line score ← score + 5?

    score ← 0 score ← score + 5 PRINT score

    Listen

    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. A strong answer earns marks for these 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. Exam tip: Read the code first and name the component you can actually see before checking the options.

    See it

    A flowchart with a top node labelled Program branching down to eight nodes: Constants and variables; Initialisation and assignment; Command sequence; Selection; Repetition and iteration; Data structures; Subprograms and parameters; Input/output.
    It shows the structural components of a program listed in the teaching note.

    Key words

    Say what each word means before you turn the card.

    Constant

    Try answering aloud or in your head before turning the card.

    Variable

    Try answering aloud or in your head before turning the card.

    Initialisation

    Try answering aloud or in your head before turning the card.

    Selection

    Try answering aloud or in your head before turning the card.

    See every definition
    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, while assignment later replaces that value.
    Selection
    Choosing between alternative paths, for example with if or case.

    Label the diagram

    Some boxes have lost their names. Pick the right name for each number.

    The diagram again, with 3 boxes numbered instead of named. A flowchart with a top node labelled Program branching down to eight nodes: Constants and variables; Initialisation and assignment; Command sequence; Selection; Repetition and iteration; Data structures; Subprograms and parameters; Input/output.
    • 1Box 1

    • 2Box 2

    • 3Box 3

    0 of 3 labelled

    There is more to this lesson

    The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.

    Carry on with the full lesson

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge

    Test your understanding of Constructs: 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)

    Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.

    Take topic quiz

    A week of Premium from your first lesson · Then the free plan continues · No card, no charge