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 print "Pass" end if | AAn if-then block with two body statements — both are indented inside the block and both execute only when n is not equal to zero | |
| 2if n != 0 then result <- 100 / n print result end if | BA complete if-then block: condition opens with then, the body is indented, and end if closes the block; the body runs only when score >= 50 is true | |
| 3The body of an if-then block is skipped entirely when the condition is false — execution jumps to the line after end if | CWrong — the body `print n` is not indented. The body of an if-then block must be indented to show it belongs inside the block | |
| 4end if closes the if block at the same indentation level as the opening if keyword | Dif total > 0 then print total end if print "Done" | |
| 5if age >= 18 print "Adult" end if | EWrong — the condition is missing the required `then` keyword. The correct form is `if age >= 18 then` with then after the condition | |
| 6if n > 0 then print n end if | Fif x > 0 then x <- x + 1 end if |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
end if — The closing keyword that ends an if-then block in VCAA pseudocode. Every if block must be closed with end if at the same indentation level as the opening if keywordif score >= 50 then
print "Pass"
end ifif n > 0 then
print n
end ifif age >= 18 then
print "Adult"
end ifif total > 100 then
discount <- total / 10
end ifif x != 0 then
result <- 100 / x
end if