Skip to main content
EnglandComputer ScienceSyllabus dot point

What are the three programming constructs, and how do you use selection and the two kinds of iteration?

The three programming constructs: sequence, selection (if and nested if) and iteration (count-controlled and condition-controlled loops), and when to use each.

An Eduqas GCSE Computer Science answer on the three programming constructs: sequence, selection (if, else, nested if) and iteration (count-controlled for loops and condition-controlled while loops), with worked pseudocode for each.

Generated by Claude Opus 4.811 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. Sequence
  3. Selection
  4. Iteration
  5. Try this

What this dot point is asking

Eduqas wants you to use the three programming constructs: sequence, selection and iteration. You must know selection with if, else and nested if, and the two kinds of iteration (count-controlled for loops and condition-controlled while loops), and choose the right one for a task. These constructs are the backbone of every Component 2 program.

Sequence

Selection

A grading example with if/elseif/else:

if mark >= 70 then
  grade = "A"
elseif mark >= 50 then
  grade = "B"
elseif mark >= 40 then
  grade = "C"
else
  grade = "U"
endif

Iteration

Try this

Q1. Name the three programming constructs. [1 mark]

  • Cue. Sequence, selection and iteration.

Q2. State which kind of loop you would use to repeat a block exactly 20 times. [1 mark]

  • Cue. A count-controlled loop (a for loop).

Q3. State one difference between a count-controlled and a condition-controlled loop. [1 mark]

  • Cue. A count-controlled loop repeats a fixed, known number of times; a condition-controlled loop repeats an unknown number of times while a condition holds.

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 Component 1, 20224 marksExplain the difference between a count-controlled loop and a condition-controlled loop, and give an example of when each is the better choice.
Show worked answer →

Count-controlled loop (up to 2): repeats a fixed, known number of times using a counter (a for loop). Example: printing the twelve rows of a times table, where you know there are exactly twelve.

Condition-controlled loop (up to 2): repeats while (or until) a condition is met, when the number of repetitions is not known in advance (a while loop). Example: asking a user to enter a password until it is correct, where you do not know how many tries it will take.

Markers reward the known-versus-unknown number of repetitions distinction and a sensible example for each. Saying "for loops are faster" misses the point.

Eduqas Component 1, 20235 marksWrite an algorithm that reads a whole number and outputs whether it is positive, negative or zero, using selection.
Show worked answer →

Read the number, then use if/elseif/else to test the three cases.

input n; if n > 0 then output "positive" elseif n < 0 then output "negative" else output "zero" endif.

Marks: input (1), correct condition n > 0 with "positive" (1), correct elseif n < 0 with "negative" (1), else "zero" for the remaining case (1), correct structure and order (1).

Markers reward handling all three cases with the else catching zero. Using two separate ifs that could both run, or missing the zero case, loses marks.

Related dot points

Sources & how we know this