Skip to content
MathsGenie logo
Open app

Course home

  1. GCSE
  2. Computer Science AQA
  3. Question bank

Programming concepts

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940
Question 27

Consider the following pseudocode algorithm:

1  total ← 0
2  FOR i ← 1 TO 5
3      x ← USERINPUT
4      IF x < 0 THEN
5          total ← total + x * x
6      ELSE
7          WHILE x > 0
8              total ← total + x
9              x ← x - 1
10         ENDWHILE
11     ENDIF
12 ENDFOR

Where is selection first used in this algorithm?

Line 2\text{Line } 2Line 2

Line 4\text{Line } 4Line 4

Line 6\text{Line } 6Line 6

Line 7\text{Line } 7Line 7

Programming concepts Questions

  1. GCSE
  2. /Computer Science
  3. /Programming concepts