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 result | Areturn should not use parentheses around its value | |
| 2return num * num | Boutput ← addNumbers(3, 4) | |
| 3A keyword that sends a value back and ends a function's execution | Creturn | |
| 4Storing the value sent back by a function in a variable | DThe keyword should be written in lowercase as return, not RETURN | |
| 5define isEven(num) IF num MOD 2 = 0 THEN RETURN TRUE END IF end function | ECalculates a value and sends it back immediately | |
| 6define getMax(a, b) IF a > b THEN return a ELSE return(b) END IF end function | FSends the value stored in result back from the function |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
return — A keyword that sends a value back from a function to where it was called, ending the function's execution at that pointreturn resultdefine square(num)
return num * num
end functiondefine isPositive(num)
IF num > 0 THEN
return TRUE
END IF
end functiondefine multiply(x, y)
return x * y
end functionoutput ← addNumbers(3, 4)
// this stores the returned value