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 each mark to Total | AThe keywords if, then and endif are in lower case; Cambridge pseudocode writes them in capitals (IF, THEN, ENDIF) | |
| 2FOR Index ← 1 TO 10 | BA comment: two slashes start a note for the reader that is not part of the algorithm's steps | |
| 3Lines inside a loop or IF are indented so the structure is easy to see | CTotal ← 0 Count ← 0 | |
| 4Each line holds one statement only | DThe line inside the WHILE loop is not indented, so the loop body is hard to see | |
| 5if Score > 50 then OUTPUT "Pass" endif | EFOR Count ← 1 TO 5 OUTPUT Count NEXT Count | |
| 6WHILE Num < 10 DO Num ← Num + 1 ENDWHILE | FKeywords FOR and TO are written in capital letters so they stand out from variable names |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
UPPERCASE keywords — Cambridge pseudocode writes keywords like IF, FOR and WHILE in capitals and indents the lines inside each structure, so the code is easy to read.FOR Index ← 1 TO 5
OUTPUT Index
NEXT IndexIF Score >= 50 THEN
OUTPUT "Pass"
ENDIFTotal ← 0
// add each mark to the total
Total ← Total + MarkWHILE Count <= 10 DO
Count ← Count + 1
ENDWHILEREPEAT
Num ← Num + 1
UNTIL Num = 5