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 | AFOR Count <- 1 TO 5 OUTPUT Count NEXT Count | |
| 2NEXT Count | BThe loop has no NEXT Count line, so it is never closed. | |
| 3A loop that must run exactly 5 times, with the counter going 1 to 5 | CStarts a loop that repeats the indented lines 10 times, with Count going 1, 2, 3 ... 10 | |
| 4A loop from 3 to 7 runs 5 times because end - start + 1 = 5 | DEnds the FOR loop and names the same counter that the FOR line used | |
| 5FOR Count <- 1 TO 10 OUTPUT Count NEXT Counter | ENEXT names a different variable (Counter) from the one in the FOR line (Count). The counter names must match. | |
| 6FOR Count <- 1 TO 10 OUTPUT Count | FFOR Num <- 3 TO 7 OUTPUT Num NEXT Num |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
FOR Count <- 1 TO 10 — A count-controlled loop that repeats the indented lines end - start + 1 times, adding 1 to the counter each time. It is closed by NEXT Count, which names the same counter.FOR Count <- 1 TO 10
OUTPUT Count
NEXT CountFOR Count <- 1 TO 10
OUTPUT Count
NEXT CountFOR Count <- 1 TO 5
OUTPUT "Hello"
NEXT CountFOR Count <- 1 TO 10
OUTPUT Count * 2
NEXT CountFOR Num <- 1 TO 5
OUTPUT "Go"
NEXT Num