20 original exam-style questions - 9 pages of questions with a full mark scheme - free printable PDF.
total <- 0
FOR i <- 1 TO 5
total <- total + i
NEXT i
OUTPUT totalcount <- 0
num <- 18
WHILE num > 1
num <- num / 2
count <- count + 1
ENDWHILE
OUTPUT counttotal <- 0
FOR i <- 1 TO 20
IF i / 2 = 0 THEN
total <- total + 1
ENDIF
NEXT i
OUTPUT totalFUNCTION doubleIfEven(num)
IF num MOD 2 = 0 THEN
RETURN num * 2
ELSE
RETURN num
ENDIF
ENDFUNCTION
total <- 0
FOR i <- 1 TO 4
total <- total + doubleIfEven(i)
NEXT i
OUTPUT totalmax <- scores[0]
FOR i <- 1 TO 9
IF scores[i] > max THEN
max <- scores[i]
ENDIF
NEXT i
OUTPUT maxREPEAT
INPUT num
UNTIL num >= 1 AND num <= 10
OUTPUT "Valid"total <- 0
FOR i <- 1 TO 20
IF i MOD 2 = 0 THEN
total <- total + i
ENDIF
NEXT i
OUTPUT totalFOR i <- 0 TO 4
FOR j <- 0 TO 4 - i
IF numbers[j] > numbers[j + 1] THEN
temp <- numbers[j]
numbers[j] <- numbers[j + 1]
numbers[j + 1] <- temp
ENDIF
NEXT j
NEXT i