Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

Constructs

EasyMedium
1234567891011121314
Question 10

Figure 1

LinePseudocode
01SET scores TO [45, 62, 28, 90, 15, 78]
02SET passes TO 0
03SET fails TO 0
04SET i TO 0
05
06WHILE i < LENGTH(scores) DO
07    IF scores[i] >= 50 THEN
08        SET passes TO passes + 1
09    ELSE
10        SET fails TO fails + 1
11    END IF
12
13    SET i TO i + 1
14END WHILE
15
16SEND "Passed: " & passes TO DISPLAY

Refer to the pseudocode algorithm in Figure 1.

Give one reason for the variable i being incremented in line 13.

[1]

Constructs Questions

  1. IGCSE
  2. /Computer Science
  3. /Constructs