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 | |
|---|---|---|
| 1CASE OF Direction | AThe 'W' case is not indented by two spaces under CASE OF | |
| 2ENDCASE | BCASE OF Direction 'W' : Position ← Position - 10 ENDCASE | |
| 3Each case is a single value, a colon and a statement, indented two spaces, and the structure ends with ENDCASE | CENDCASE is missing, so the CASE structure is never closed | |
| 4Only the first matching case runs, so if Direction is 'W' only the 'W' statement is carried out | DStarts a CASE structure that compares the variable Direction with a list of single values | |
| 5CASE OF Direction 'W' : Position ← Position - 10 | EMarks the end of the CASE structure | |
| 6CASE OF Direction 'W' : Position ← Position - 10 ENDCASE | FCASE OF Direction 'W' : Position ← Position - 10 'E' : Position ← Position + 10 ENDCASE |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
CASE OF ... ENDCASE — Compares one variable with a list of single values and runs the statement for the first match only. Each case is indented two spaces and the structure ends with ENDCASE.CASE OF Direction
'W' : Position ← Position - 10
ENDCASECASE OF Direction
'W' : Position ← Position - 10
ENDCASECASE OF Direction
'W' : Position ← Position - 10
ENDCASECASE OF Direction
'W' : Position ← Position - 10
ENDCASECASE OF Direction
'W' : Position ← Position - 10
ENDCASE