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 | |
|---|---|---|
| 1define addNumbers(a, b) | ACloses a function definition | |
| 2end function | B(a, b) | |
| 3A keyword that starts a function's definition and names it | Cdefine | |
| 4Values listed in brackets after the function name that the function accepts | DThe closing keywords should be written as end function, not func end | |
| 5DEFINE greetUser(name) DISPLAY "Hello " + name end function | EThe keyword should be written in lowercase as define, not DEFINE | |
| 6define subtract(a, b) result ← a - b DISPLAY result func end | FStarts a function named addNumbers with two parameters |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
define — A keyword that starts a function definition, naming the function and listing the parameters it acceptsdefine addNumbers(a, b)define addNumbers(a, b)
result ← a + b
DISPLAY result
end functiondefine greetUser(name)
DISPLAY "Hello " + name
end functiondefine multiply(x, y)
result ← x * y
DISPLAY result
end functiondefine square(num)
DISPLAY num * num
end function