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 | |
|---|---|---|
| 1Total ← SumSquare(10, 20) + 1 | AScore ← Double(5) + 10 | |
| 2Answer ← 2 * Cube(3) | BCALL is used with a function. CALL is only for procedures. A function call is written inside the expression without CALL: Total ← SumSquare(10, 20) + 1. | |
| 3A function is called by writing its name with the values in brackets. No CALL keyword is used. | CCube is called with 3. The returned value replaces Cube(3), then it is multiplied by 2 and stored in Answer. | |
| 4A function call is not a complete statement on its own. It is placed inside an expression so the returned value is used. | DThe function is called with 10 and 20. Its returned value replaces the call, then 1 is added and the answer is stored in Total. | |
| 5Total ← CALL SumSquare(10, 20) + 1 | EResult ← SumSquare(3, 4) | |
| 6SumSquare(10, 20) + 1 | FThe function call and calculation are written on their own as a statement, so the returned value is not stored or output. It should be assigned or output, e.g. Total ← SumSquare(10, 20) + 1. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
SumSquare(10, 20) + 1 — A function call is written inside an expression, with no CALL keyword. The returned value replaces the call, then the rest of the expression is worked out.Total ← SumSquare(10, 20) + 1Result ← 2 * SumSquare(1, 2)Total ← SumSquare(10, 20) + 1IF IsEven(8) = TRUE THEN
OUTPUT "Even"
ENDIFOUTPUT SumSquare(10, 20) + 1