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 ShowLine() OUTPUT "-----" ENDPROCEDURE | AA procedure must not contain RETURN with a value because it does not return a value. Remove the RETURN line. | |
| 2CALL ShowLine() | BENDPROCEDURE | |
| 3A procedure can have a parameter so it can do its job with a value passed in | CPROCEDURE Greet(Name : STRING) | |
| 4A procedure does not return a value, so it ends with ENDPROCEDURE and has no RETURN | DA procedure returns no value, so its result cannot be stored in a variable. It should be called with CALL ShowLine(). | |
| 5x ← ShowLine() | EA complete statement that runs the procedure ShowLine | |
| 6PROCEDURE ShowLine() OUTPUT "-----" RETURN 5 ENDPROCEDURE | FA procedure with no parameters that does a job (outputs a line) and does not return a value |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
PROCEDURE — A named subroutine that does a job, like outputting a line, but does not return a value. It is called as a full statement and can have parameters or none.PROCEDURE ShowMenu()
OUTPUT "Menu"
ENDPROCEDUREPROCEDURE ShowMenu()
OUTPUT "Menu"
ENDPROCEDURECALL ShowMenu()PROCEDURE Greet(Name : STRING)
OUTPUT "Hello ", Name
ENDPROCEDUREPROCEDURE Greet(Name : STRING)
OUTPUT "Hi ", Name
ENDPROCEDURE