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 | |
|---|---|---|
| 1IF Age >= 16 THEN OUTPUT "Adult" | AENDIF is indented two spaces. It must line up with IF, in the same column. | |
| 2 ELSE OUTPUT "Child" | BTHEN is on its own line, two spaces in from IF. The statement inside THEN is indented further. | |
| 3THEN and ELSE are two spaces in from IF, the statements inside are indented further, and ENDIF lines up with IF. | CTHEN is not indented. It must be two spaces in from IF, with the OUTPUT statement indented further. | |
| 4A nested IF keeps the same two-space step. The inner IF sits inside THEN and its own ENDIF lines up with the inner IF. | DELSE is on its own line, two spaces in from IF. The statement inside ELSE is indented further. | |
| 5IF Score >= 50 THEN OUTPUT "Pass" ENDIF | EIF Age >= 16 THEN IF Age >= 65 THEN OUTPUT "Senior" ENDIF ENDIF | |
| 6IF Score >= 50 THEN OUTPUT "Pass" ENDIF | FIF Score >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
THEN — THEN and ELSE sit two spaces in from IF, on their own lines. The statements inside each go further in, and ENDIF lines up with IF. Nested IFs keep the same two-space step.IF Score >= 50
THEN
OUTPUT "Pass" THEN
OUTPUT "Pass"
ELSE ELSE
OUTPUT "Fail"
ENDIFIF Mark >= 50
THEN
OUTPUT "Pass" OUTPUT "Merit"
ELSE
OUTPUT "Pass"