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) | ACALL ShowPrice(20) | |
| 2FUNCTION Area(Length : INTEGER, Width : INTEGER) RETURNS INTEGER | BThe parameter has no data type. It should be written as Name : STRING. | |
| 3A parameter is used like a variable inside the subroutine body | CName is a parameter: an identifier in the definition that receives a value and has the data type STRING | |
| 4At each call a value is substituted for the parameter, so Price takes the value 20 here | DPROCEDURE ShowDouble(Num : INTEGER) OUTPUT Num * 2 ENDPROCEDURE | |
| 5PROCEDURE Greet(Name) | EFour parameters are used, but this course allows up to three parameters. | |
| 6FUNCTION Total(A : INTEGER, B : INTEGER, C : INTEGER, D : INTEGER) RETURNS INTEGER | FLength and Width are two parameters, each receiving a value when Area is called |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
parameter — An identifier in a subroutine definition that receives a value when the subroutine is called. It is used like a variable inside the subroutine and has a data type.PROCEDURE ShowDouble(Num : INTEGER)
OUTPUT Num * 2
ENDPROCEDUREPROCEDURE ShowName(Name : STRING)
OUTPUT "Hello, " & Name
ENDPROCEDUREPROCEDURE Area(Length : REAL, Width : REAL)
OUTPUT Length * Width
ENDPROCEDUREFUNCTION Half(Num : INTEGER) RETURNS REAL
RETURN Num / 2
ENDFUNCTIONPROCEDURE Check(Passed : BOOLEAN)
OUTPUT NOT Passed
ENDPROCEDURE