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| repeat | score | lives | | AThe header row of a tracking table: one column for each variable, here score and lives, plus a column for the repeat number | |
| 2| start | 0 | 3 | | B| repeat | coins | steps | | |
| 3Each time the loop repeats, you add a new row to the tracking table to show the new values | C| repeat 1 | 2 | | repeat 2 | 4 | | repeat 3 | 6 | | |
| 4Each variable gets its own column, so a table for a loop that uses coins and steps needs two value columns | DThe first row of a tracking table, which holds the starting values of the variables before any repeat happens | |
| 5| repeat | score | score + 1 | | EThe second column is an action, not a variable. A column should be named after a variable, such as lives or count, not a calculation. | |
| 6| repeat 1 | 1 | (first row, before the loop starts) | FThe first row should hold the starting values before any repeat. Here it shows the value after the first repeat, so the starting value is missing. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
tracking table — A table with a column for each variable and a row for each step or repeat. It shows how the values change, and the first row holds the starting values.SET lives TO 3
SET coins TO 0
Table columns: lives, coinsSET count TO 0
REPEAT 3 TIMES: ADD 2 TO count
Row 1 (start): count = 0REPEAT 4 TIMES
ADD 1 TO score
Repeat rows needed in table: 4SET total TO 10
SUBTRACT 3 FROM total
Row 2 (after one repeat): total = 7REPEAT UNTIL count = 3
Each repeat of the loop adds a new row