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 | |
|---|---|---|
| 1OUTPUT "Total: ", Total | AWrites the text Total: followed by the current value of Total, together in the OUTPUT column on that row. | |
| 2FOR I ← 1 TO 3 OUTPUT I NEXT I | BFOR I ← 1 TO 3 Total ← Total + I NEXT I OUTPUT Total | |
| 3Text in quotes is part of the output, so it is copied exactly into the OUTPUT column. | CWrites 1, then 2, then 3 on three separate rows of the OUTPUT column. | |
| 4An OUTPUT placed after a loop is written once, on the row after the loop has finished. | DOUTPUT "Pass" | |
| 5OUTPUT "Score" (Score is 8, but 8 is written in the OUTPUT column) | EThe OUTPUT is inside the loop, so it happens on every repeat. Writing only the last value misses the first two outputs. | |
| 6FOR I ← 1 TO 3 OUTPUT I NEXT I (only 3 is written in the OUTPUT column) | FThe word Score is in quotes, so it is text. The OUTPUT column should show Score, not the value 8. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
OUTPUT column — The trace table column where you write each value or message shown by an OUTPUT statement, on the row where it happens. Text in quotes is copied exactly as the output.Total ← 5 + 3
OUTPUT TotalTotal ← 12
OUTPUT "Total: ", TotalFOR Count ← 1 TO 3
OUTPUT Count
NEXT Count Total ← Total + Count
NEXT Count
OUTPUT "Sum: ", TotalPrice ← 8
Tax ← Price DIV 2
OUTPUT "Tax: ", Tax