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 | |
|---|---|---|
| 1FOR Count ← 1 TO 10 Total ← Total + Count NEXT Count | ARepeats until the user enters -1, adding each mark to Total and then inputting the next mark | |
| 2WHILE Mark <> -1 DO Total ← Total + Mark INPUT Mark ENDWHILE | BIt does not say how many times the loop repeats or when it stops, so it is too vague. | |
| 3A count-controlled loop description gives the number of repeats: it repeats 5 times and each number input is added to Sum | CREPEAT INPUT Password UNTIL Password = "Secret" | |
| 4A condition-controlled loop description gives the stopping condition: it repeats until the password is correct, asking for a new password each time | DFOR Index ← 1 TO 5 INPUT Number Sum ← Sum + Number NEXT Index | |
| 5Description: "The loop adds numbers to Total." | ERepeats exactly 10 times, and each time round the current value of Count is added to Total | |
| 6Description: "The loop repeats 10 times." | FIt does not say what happens to the data each time round, such as which value is added or changed. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Describing a loop — State how many times the loop repeats or the condition it stops on, and what happens to the data each time round, e.g. each mark is added to Total.FOR Count ← 1 TO 5
Total ← Total + Mark
NEXT CountWHILE Total < 100 DO
Total ← Total + Mark
ENDWHILEWHILE Count <= 5 DO
Count ← Count + 1
ENDWHILEFOR Count ← 1 TO 10 STEP 2
OUTPUT Count
NEXT CountREPEAT
Total ← Total + Mark
UNTIL Total >= 100