Skip to main content
EnglandComputer ScienceSyllabus dot point

What are the primitive data types, and how do the three programming constructs build any algorithm?

Programming principles: primitive and composite data types, variables and constants, scope and lifetime, and the three programming constructs of sequence, selection and iteration used to build structured programs.

An Eduqas Component 1 answer on programming principles: the primitive data types, variables versus constants, local versus global scope and lifetime, type conversion, and the three programming constructs sequence, selection and iteration.

Generated by Claude Opus 4.813 min answer

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

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Examples in context
  4. Try this

What this dot point is asking

Eduqas wants you to know the primitive data types and when to use each, the difference between variables and constants, scope and lifetime (local versus global), type conversion, and how the three constructs (sequence, selection, iteration) build any structured program.

The answer

Primitive and composite data types

Variables, constants, scope and lifetime

The three programming constructs

Examples in context

Choosing the right type is a daily decision: a temperature sensor reads a real, a record count is an integer, an "is logged in" flag is a Boolean. The three constructs appear in every program ever written, and recognising them in pseudocode is essential for the algorithm questions. Scope discipline (locals over globals) is the foundation of the object-oriented and modular techniques in the next dot points, where encapsulation formalises the idea of keeping data local to where it belongs.

Try this

Q1. State the most suitable primitive type for a temperature reading such as 36.636.6. [1 mark]

  • Cue. Real (float), because it has a fractional part.

Q2. Define the scope of a local variable. [1 mark]

  • Cue. It can be accessed only within the subroutine in which it is declared.

Q3. Name the three programming constructs. [3 marks]

  • Cue. Sequence, selection and iteration.

Exam-style practice questions

Practice questions written in the style of WJEC Eduqas exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

Eduqas 20194 marksState the most appropriate primitive data type for each of the following, justifying your choice: a person's age, a bank balance, whether a light is on, and a postcode.
Show worked answer →

Age: integer, because age is a whole number (1 mark).

Bank balance: real (floating point), because money has a fractional part such as pence (1 mark).

Whether a light is on: Boolean, because it has exactly two states, true or false (1 mark).

Postcode: string (or character sequence), because it contains letters and digits and is not used in arithmetic (1 mark).

Markers reward the correct type for each with a brief justification. A common error is choosing integer for money (loses pence) or for a postcode (cannot hold letters).

Eduqas 20215 marksExplain the difference between a local variable and a global variable, including their scope and lifetime, and give one advantage of using local variables.
Show worked answer →

Scope (up to 2 marks): a local variable is declared inside a subroutine and can only be accessed within it; a global variable is declared in the main program and can be accessed anywhere in the program.

Lifetime (up to 2 marks): a local variable exists only while its subroutine is executing and is destroyed when the subroutine ends; a global variable exists for the whole run of the program.

Advantage (up to 1 mark): local variables avoid unintended side effects because they cannot be changed from elsewhere, which makes code easier to debug and subroutines reusable.

Markers reward the access (scope) distinction, the existence (lifetime) distinction, and a valid advantage of local variables (encapsulation, fewer side effects, reuse).

Related dot points

Sources & how we know this