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 | |
|---|---|---|
| 1RETURN Number1 * Number1 | ARETURN has no value or expression after it, so nothing is sent back. It should be RETURN A + B. | |
| 2RETURN Total | BFUNCTION Double(Num : INTEGER) RETURNS INTEGER RETURN Num * 2 ENDFUNCTION | |
| 3A function ends with RETURN as its last statement, sending back its answer | CThe function uses OUTPUT instead of RETURN, so no value is sent back to the caller. It should be RETURN Number1 * Number1. | |
| 4RETURN ends the function, so any statement written after it in the same path never runs | DRETURN Result OUTPUT "Done" | |
| 5FUNCTION Square(Number1 : INTEGER) RETURNS INTEGER OUTPUT Number1 * Number1 ENDFUNCTION | ESends the value stored in the variable Total back to the place where the function was called | |
| 6FUNCTION Add(A : INTEGER, B : INTEGER) RETURNS INTEGER RETURN ENDFUNCTION | FWorks out the square of Number1 and sends that value back to where the function was called |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
RETURN — RETURN followed by a value or expression sends that value back to where the function was called, e.g. RETURN Number1 * Number1. It also ends the function.FUNCTION Sq(Number1 : REAL) RETURNS REAL
RETURN Number1 * Number1
ENDFUNCTIONFUNCTION Sq(Number1 : REAL) RETURNS REAL
RETURN Number1 * Number1
ENDFUNCTION Sum ← A + B
RETURN Sum
ENDFUNCTIONResult ← Sq(5)
OUTPUT ResultFUNCTION Pass(Mark : INTEGER) RETURNS BOOLEAN
RETURN Mark >= 50
ENDFUNCTION