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(3, 4) | ADECLARE Total : INTEGER Total ← SumSquare(3, 4) | |
| 2OUTPUT Total | BCalls SumSquare with 3 and 4, then stores the value it returns in the variable Total. | |
| 3The variable that stores a returned value must have the same type as the function's return type, so a function that returns INTEGER is stored in an INTEGER variable. | CThe returned value is never stored. Total has no value because the call is not assigned, so it should be Total ← SumSquare(3, 4). | |
| 4Calling the same function twice with different values gives two results, which can be stored in two different variables. | DFirst ← SumSquare(3, 4) Second ← SumSquare(5, 6) | |
| 5SumSquare(3, 4) ← Total | EUses the stored result later in the program by displaying the value held in Total. | |
| 6SumSquare(3, 4) OUTPUT Total | FThe arrow points the wrong way. The variable must be on the left and the function call on the right, as in Total ← SumSquare(3, 4). |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Total ← SumSquare(3, 4) — The function runs, and the value it returns is stored in the variable on the left of the arrow. You can use that variable later. Its type must match the function's return type.Total ← SumSquare(3, 4)Total ← SumSquare(3, 4)Total ← SumSquare(3, 4)
OUTPUT TotalDECLARE Total : INTEGER
Total ← SumSquare(3, 4)Total1 ← SumSquare(3, 4)
Total2 ← SumSquare(5, 6)
OUTPUT Total1 + Total2