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 Choice 1: IF Age >= 16 THEN OUTPUT "OK" ENDIF ENDCASE | AThe closing keywords are in the wrong order. The inner CASE must end with ENDCASE before the outer IF ends with ENDIF. | |
| 2IF Score > 0 THEN CASE OF Grade 'A': OUTPUT "Top" ENDCASE ENDIF | BIF Member = TRUE THEN CASE OF Level 1: OUTPUT "Bronze" 2: OUTPUT "Silver" ENDCASE ENDIF | |
| 3The inner structure must be closed first, so the closing keywords appear in the reverse order to the opening ones: ENDIF then ENDCASE. | CAn IF statement placed inside a CASE clause. The IF is closed with ENDIF first, then the CASE is closed with ENDCASE. | |
| 4An IF branch can contain a CASE, and that CASE needs its own ENDCASE before the IF's ENDIF. | DThe IF inside the CASE clause has no ENDIF. Add ENDIF after the OUTPUT line, before ENDCASE. | |
| 5CASE OF Choice 1: IF Age >= 16 THEN OUTPUT "OK" ENDCASE | EA CASE statement placed inside an IF branch. The CASE is closed with ENDCASE first, then the IF is closed with ENDIF. | |
| 6IF Score > 0 THEN CASE OF Grade 'A': OUTPUT "Top" ENDIF ENDCASE | FCASE OF Day 1: IF Wet = TRUE THEN OUTPUT "Bring coat" ENDIF 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 ... IF ... ENDIF ... ENDCASE — A CASE clause can hold an IF, and an IF branch can hold a CASE. Close the inner structure first with its own ENDIF or ENDCASE, then close the outer one.CASE OF Option
1 : IF Score > 50 THEN OUTPUT "Pass" ENDIF
ENDCASECASE OF Option
2 : IF Lives = 0 THEN OUTPUT "Over" ENDIF
ENDCASECASE OF Option
1 : IF Score > 50 THEN OUTPUT "Pass" ENDIF
ENDCASEIF Member = TRUE THEN CASE OF Level
1 : OUTPUT "Gold"
ENDCASE ENDIFIF Age > 12 THEN CASE OF Level
1 : OUTPUT "Easy"
ENDCASE ENDIF