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 | |
|---|---|---|
| 1PROCEDURE Greet(Name : STRING) | AA definition needs a parameter name and type, such as Num : INTEGER, not a fixed value. The value 5 belongs in the call. | |
| 2CALL Greet("Ava") | BThe call includes the parameter name and data type, which belong in the definition. A call should give a value such as 5. | |
| 3The same procedure can be called with different values, so the parameter holds a different value each time | CThe value "Ava" is given to the procedure, so the parameter Name holds "Ava" while it runs | |
| 4A variable can supply the value in a call, and the parameter holds that variable's current value | DName is a parameter: a name in the definition that will hold the value given in the call | |
| 5CALL Show(Num : INTEGER) | ECALL Show(5) CALL Show(9) | |
| 6PROCEDURE Show(5) OUTPUT 5 ENDPROCEDURE | FScore ← 40 CALL Show(Score) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
parameter — A name in the subroutine definition that holds the value given in the call while it runs. With PROCEDURE Show(Num : INTEGER), CALL Show(5) makes Num hold 5.PROCEDURE Show(Num : INTEGER)
OUTPUT Num
ENDPROCEDUREScore ← 8
CALL Show(Score)
// Num holds 8 while Show runsCount ← 4
CALL Show(Count * 2)
// Num holds 8 while Show runsPROCEDURE Double(Num : INTEGER)
OUTPUT Num * 2
ENDPROCEDURECALL Show(2)
CALL Show(7)
// Same procedure, new value in the call