Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1Counter ← 0 | ACounter ← Counter + 1 is outside the IF, so it counts every number entered, not only the numbers greater than 5. | |
| 2Counter ← Counter + 1 | BAdds 1 to the counter each time it runs, so the counter goes up by one | |
| 3Count only the marks that are 50 or more by putting the increase inside an IF that is true only for those marks | CInitialises the counter to zero before the loop starts, so counting begins from nothing | |
| 4Count only the valid entries by increasing the counter after a check shows the input is within the allowed range | DCounter ← 0 is inside the loop, so the counter resets to zero on every repeat and the count is lost. It must be set before the loop starts. | |
| 5FOR Index ← 1 TO 10 Counter ← 0 INPUT Number IF Number > 5 THEN Counter ← Counter + 1 ENDIF NEXT Index | EIF Age >= 11 AND Age <= 16 THEN ValidCount ← ValidCount + 1 ENDIF | |
| 6Counter ← 0 FOR Index ← 1 TO 10 INPUT Number Counter ← Counter + 1 IF Number > 5 THEN OUTPUT Number ENDIF NEXT Index | FIF Mark >= 50 THEN Passes ← Passes + 1 ENDIF |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Counter ← Counter + 1 — A counter is a variable set to 0 before a loop, then increased by 1 with Counter ← Counter + 1 each time the thing being counted happens.Counter ← 0
FOR Index ← 1 TO 10
INPUT NumIF Mark >= 50 THEN
Passes ← Passes + 1
ENDIFIF Score > 90 THEN
Top ← Top + 1
ENDIFIF Age >= 18 THEN
Adults ← Adults + 1
ENDIFIF Num >= 1 AND Num <= 10 THEN
Valid ← Valid + 1
ENDIF