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 | |
|---|---|---|
| 1REPEAT 3 TIMES REPEAT 4 TIMES SAY "Hi" | ANothing is indented, so it is hard to see that the inner loop sits inside the outer loop. Both loops should be indented. | |
| 2REPEAT 2 TIMES REPEAT 5 TIMES SAY "Go" | BREPEAT 4 TIMES REPEAT 3 TIMES CHECK SEAT END REPEAT END REPEAT | |
| 3Both loops are indented so you can see which loop sits inside the other, and each loop is closed with its own END REPEAT. | CREPEAT 3 TIMES REPEAT 2 TIMES SAY "Step" END REPEAT END REPEAT | |
| 4The inner loop is a complete REPEAT that starts over for each outer repeat, like 4 rows of 3 seats gives 12 seat checks. | DThere is only one END REPEAT for two loops. Each loop needs its own END REPEAT, so a second one is missing. | |
| 5REPEAT 3 TIMES REPEAT 4 TIMES SAY "Hi" END REPEAT | EThe inner loop runs 5 times for each of the 2 outer repeats, so Go is said 10 times. | |
| 6REPEAT 3 TIMES REPEAT 4 TIMES SAY "Hi" END REPEAT END REPEAT | FThe inner loop runs 4 times for each of the 3 outer repeats, so Hi is said 12 times. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
nested loop — A REPEAT placed inside another REPEAT. The inner loop runs all its repeats again for every repeat of the outer loop, so an outer 3 and an inner 4 gives 12 inner passes.REPEAT 3 TIMES
REPEAT 4 TIMES
PRINT "*"SET outer ← 3
SET inner ← 4
SET passes ← outer * inner PRINT "*"
END REPEAT
END REPEATREPEAT 2 TIMES
REPEAT 5 TIMES
PRINT "ping" // 10 pings in allREPEAT 3 TIMES
REPEAT 4 TIMES
PRINT "x" // 12 inner passes in all