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 | |
|---|---|---|
| 1// Add the mark to the total | AThe loop body is not indented. OUTPUT Count should be indented four spaces so it is clearly inside the loop. | |
| 2Total <- Total + Mark // running total | BA comment on its own line. The computer ignores it; it explains the code to a human reader. | |
| 3The body of a FOR loop is indented four spaces so the repeated statements stand out | CELSE is indented. It should line up with its IF at the left edge. | |
| 4ELSE lines up with its IF, and the statements in each branch are indented four spaces | DFOR Count <- 1 TO 5 OUTPUT Count NEXT Count | |
| 5FOR Count <- 1 TO 3 OUTPUT Count NEXT Count | EIF Mark >= 50 THEN OUTPUT "Pass" ELSE OUTPUT "Fail" ENDIF | |
| 6IF Age >= 16 THEN OUTPUT "Adult" ELSE OUTPUT "Child" ENDIF | FA comment after a statement. The assignment still runs and everything after // is ignored. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
// — Starts a comment in Cambridge pseudocode. Statements inside a loop or IF are indented four spaces, and ELSE lines up with its IF, so the structure is easy to read.// Ask the user for a name
INPUT NameFOR Count <- 1 TO 5
OUTPUT Count // show the number
NEXT CountIF Mark >= 50 THEN
OUTPUT "Pass"
ENDIFWHILE Num > 0 DO
Num <- Num - 1
ENDWHILEFOR Count <- 1 TO 3
// Print the count
OUTPUT Count