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 | |
|---|---|---|
| 1IF Mark[i] >= 50 THEN Count ← Count + 1 | AIF Name[i] = "Ali" THEN Count ← Count + 1 | |
| 2IF Colour[i] = "Red" AND Size[i] > 10 THEN Count ← Count + 1 | BCounts only the items that are red and also bigger than 10, because AND needs both conditions to be true | |
| 3To count how many names are "Ali", add 1 to Count only when the current name matches the string | CThis adds the mark's value to Count instead of 1, so it is making a total, not counting passes. | |
| 4A counter goes up by 1 for each matching item, but a total goes up by the item's value | DThe counter is updated outside the IF, so every mark is counted, not just those that are 50 or more. | |
| 5FOR i ← 1 TO 10 Count ← Count + 1 IF Mark[i] >= 50 THEN ENDIF NEXT i | ETotal ← Total + Mark[i] | |
| 6IF Mark[i] >= 50 THEN Count ← Count + Mark[i] | FAdds 1 to Count only when the current mark is 50 or more, so Count tallies the passing marks |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IF Mark[i] >= 50 THEN Count ← Count + 1 — An IF inside a loop adds 1 to Count only when an item meets the condition, so Count tallies the matching items. A total adds the item's value instead.IF Mark[i] >= 50 THEN Count ← Count + 1IF Name[i] = "Ali" THEN Count ← Count + 1IF Mark[i] >= 50 AND Mark[i] < 70 THEN
Count ← Count + 1
ENDIFIF Mark[i] >= 50 THEN
Total ← Total + Mark[i]
ENDIFIF Mark[i] >= 50 THEN
Count ← Count + 1
ENDIF