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 GetMarks() | APROCEDURE Main() CALL GetMarks() CALL Calculate() CALL ShowResult() ENDPROCEDURE | |
| 2CALL GetMarks() | BThe sub-box is run without the CALL keyword. A procedure must be run with CALL GetMarks(). | |
| 3A box at the top of a structure diagram with three sub-boxes becomes a routine that makes three CALL statements | CFUNCTION Average(Total : INTEGER) RETURNS REAL RETURN Total / 3 ENDFUNCTION | |
| 4A bottom-level box that works out and gives back a value becomes a FUNCTION that RETURNS it | DA bottom-level box called Get Marks becomes a procedure with the same name | |
| 5PROCEDURE Main() CALL GetMarks() ENDPROCEDURE // the diagram also has Show Result | EA parent box runs its sub-box by calling the sub-box's procedure | |
| 6PROCEDURE Main() GetMarks() ENDPROCEDURE | FThe box Show Result has no CALL statement in Main, so one box has no code. Every box in the diagram must be checked and given code. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
PROCEDURE — Each box in a structure diagram becomes a PROCEDURE or FUNCTION named after the box. A box with sub-boxes uses CALL statements to run them. Check that every box has code.PROCEDURE ShowMenu()
OUTPUT "Menu"
ENDPROCEDUREPROCEDURE RunGame()
CALL GetName()
ENDPROCEDUREPROCEDURE ShowScore()
OUTPUT "Score: ", Score
ENDPROCEDUREFUNCTION CalcTotal() RETURNS INTEGER
RETURN Price * Qty
ENDFUNCTIONPROCEDURE SaveData()
OUTPUT "Saved"
ENDPROCEDURE