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 score >= 50 then | AThe condition was worked out wrongly. 3 > 5 is FALSE, so the then branch should be skipped. | |
| 2else | B| age | age >= 13 | message | | |
| 3The trace table has a column to record the condition result for each check | CBoth branches were followed. Only the branch that matches the condition result is followed. | |
| 4If the condition is FALSE, skip the then branch and do not change its variables in the table | DThe branch that is skipped when the condition was TRUE, and followed only when it was FALSE | |
| 5x = 3, x > 5 is TRUE, so follow the then branch | EWork out score >= 50 with the current value of score, then write TRUE or FALSE in the trace table | |
| 6temp = 30, temp > 25 is TRUE: do then AND else | Fx <- 4 if x > 10 then x <- 0 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
trace an if — Check the condition using the current values, record TRUE or FALSE in the trace table, then follow only the branch that is true and skip the other branch.Trace row: score=45, score >= 50 is FALSEIf the condition is FALSE
, skip the then branchx=4 | x > 10 | FALSE | then skippedage=15 | age >= 18 | FALSE | else runsn <- 7
if n > 5 then
print "Big"