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 | |
|---|---|---|
| 1OTHERWISE : OUTPUT "Invalid" | AOTHERWISE is not the last clause. It must come after all the case values, so the 2 case should be placed before it. | |
| 2ENDCASE | BCASE OF Day 1 : OUTPUT "Mon" 2 : OUTPUT "Tue" OTHERWISE : OUTPUT "Other" ENDCASE | |
| 3Each case has one value, then a colon, then the statement to run when the variable equals that value. | CThe last clause of a CASE structure. It runs only if no case value matches the variable. | |
| 4OTHERWISE is written last, after every case value, and covers all values that do not match. | DCASE OF Grade "A" : OUTPUT "Top" "B" : OUTPUT "Good" ENDCASE | |
| 5CASE OF Choice 1 : OUTPUT "Start" OTHERWISE : OUTPUT "Error" 2 : OUTPUT "Stop" ENDCASE | ECloses the CASE OF structure. | |
| 6CASE OF Choice 1 : OUTPUT "Start" 2 : OUTPUT "Stop" ENDIF | FThe structure is closed with ENDIF instead of 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 — Runs the statement beside the first value that matches the variable. An optional OTHERWISE clause, placed last, runs if nothing matches. ENDCASE closes the structure.CASE OF Choice
1 : OUTPUT "Start"
ENDCASECASE OF Choice
1 : OUTPUT "Start"
ENDCASE 2 : OUTPUT "Stop"
OTHERWISE : OUTPUT "Invalid"
ENDCASECASE OF Choice
1 : OUTPUT "Start"
ENDCASE 1 : OUTPUT "One"
2 : OUTPUT "Two"
3 : OUTPUT "Three"