Question 1
7 marksDid your answer earn the marks?
20 original exam-style questions - 9 pages of questions with a full mark scheme - free printable PDF.
INPUT score IF score >= 90 THEN OUTPUT "Distinction" ELSE IF score >= 70 THEN OUTPUT "Merit" ELSE IF score >= 40 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF
total = 0 FOR i = 1 TO 5 total = total + i * 2 NEXT i OUTPUT total
total = 0
FOR num = 1 TO 10
IF num MOD 2 == 1 THEN
total = total + num
ENDIF
NEXT num
OUTPUT totalINPUT isStudent
INPUT spend
IF isStudent == True THEN
IF spend > 15 THEN
OUTPUT 20
ELSE
OUTPUT 10
ENDIF
ELSE
OUTPUT 0
ENDIFfile = OPENFILE("players.txt", READ)
WHILE NOT EOF(file)
line = READFILE(file)
OUTPUT line
ENDWHILECLOSEFILE(file)INPUT age WHILE age < 0 OR age > 120 OUTPUT "Invalid age, try again" INPUT age ENDWHILE OUTPUT "Age accepted"
total = 0 FOR i = 0 TO 5 total = total + temps[i] NEXT i mean = total / 6 OUTPUT mean
FUNCTION findLargest(num1, num2)
IF num1 > num2 THEN
RETURN num1
ELSE
RETURN num2
ENDIF
ENDFUNCTIONcount = 0
FOR row = 0 TO 2
FOR col = 0 TO 2
IF board[row, col] == "X" THEN
count = count + 1
ENDIF
NEXT col
NEXT row
OUTPUT countDECLARE scores : ARRAY[0:7] OF INTEGER
total = 0
FOR i = 0 TO 7
INPUT mark
WHILE mark < 0 OR mark > 100
OUTPUT "Invalid, enter again"
INPUT mark
ENDWHILE
scores[i] = mark
total = total + scores[i]
NEXT i
average = total / 8
OUTPUT average
IF average >= 60 THEN
OUTPUT "Well done, class!"
ELSE
OUTPUT "More revision needed"
ENDIFThis checks your answers in your browser, stores nothing on a server and needs no account.