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 | |
|---|---|---|
| 1OUTPUT SumSquare(10, 20) | ATotal ← SumSquare(10, 20) OUTPUT Total | |
| 2OUTPUT "Sum of squares = ", SumSquare(10, 20) | BThere is no comma between the text and the function call, so the two items are not separated correctly | |
| 3A function call can be placed straight into OUTPUT, so there is no need to store the result first | CDisplays the text first, then the value returned by the function call, on the same line | |
| 4A function result can be stored in a variable, and then the variable is displayed with OUTPUT | DThe function name is written without brackets and arguments, so the function is not called | |
| 5OUTPUT "Sum of squares = " SumSquare(10, 20) | ECalls the function SumSquare with 10 and 20, then displays the value it returns | |
| 6OUTPUT "Sum of squares = ", SumSquare | FOUTPUT SumSquare(a, b) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
OUTPUT SumSquare(10, 20) — Puts a function call inside OUTPUT. The function runs first, then the value it RETURNs is displayed. Text can be added: OUTPUT "Sum = ", SumSquare(10, 20).OUTPUT SumSquare(10, 20)OUTPUT "Sum of squares = ", SumSquare(10, 20)Total ← SumSquare(10, 20)
OUTPUT "Sum of squares = ", Totala ← 3
OUTPUT "Sum of squares = ", SumSquare(a, 4)b ← 20
OUTPUT "Sum of squares = ", SumSquare(10, b)