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 | |
|---|---|---|
| 1Count ← Count + 1 | AIF Mark >= 50 THEN Count ← Count + 1 ENDIF | |
| 2OUTPUT Count | BCount ← 0 | |
| 3When the condition is FALSE, the counter stays the same, so the Count column repeats the previous value | CThe OUTPUT must show the final value of Count from the last row of the trace table, which is 3 | |
| 4The counter must start at 0 so the first row of the trace table shows Count as 0 before any items are checked | DShows the final value of Count after the loop has finished, not the value on any one row | |
| 5Mark = 40 → condition (Mark >= 50) = TRUE, Count goes from 2 to 3 | E40 is not greater than or equal to 50, so the condition is FALSE and Count should stay at 2 | |
| 6Final row of trace table: Count = 3, but OUTPUT Count shows 2 | FIn the trace table, Count goes up by 1 only on rows where the condition is TRUE |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Count ← Count + 1 — In a trace table, Count goes up by 1 only on rows where the condition is TRUE. If it is FALSE, Count stays the same. The final value of Count is what the OUTPUT shows.IF Mark >= 50 THEN
Count ← Count + 1
ENDIFIF Mark >= 50 THEN
Count ← Count + 1
ENDIFIF Mark >= 50 THEN
Count ← Count + 1
ENDIFNEXT Index
OUTPUT CountCount ← 0
FOR Index ← 1 TO 5