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 | |
|---|---|---|
| 1IF Number > Largest THEN Largest ← Number | ANumber | Number > Largest | Largest 9 | TRUE | 9 4 | FALSE | 9 | |
| 2IF Number < Smallest THEN Smallest ← Number | B3 > 8 is FALSE, not TRUE. Largest must stay 8 because 3 is smaller, so it must not change to 3. | |
| 3A comparison column in the trace table records TRUE or FALSE for the test. Largest changes only on TRUE rows. | COn the row where Number is 2, Smallest should change to 2 because 2 < 5 is TRUE. Smallest was wrongly left at 5. | |
| 4A tie does not change the stored value: if Number equals Largest, the test Number > Largest is FALSE. | DSmallest changes only on rows where Number is strictly lower than the stored Smallest; otherwise its cell stays the same as the row above. | |
| 5Number = 3, Largest = 8 3 > 8 is TRUE, so Largest becomes 3 | ELargest = 7, Number = 7 7 > 7 is FALSE, so Largest stays 7 | |
| 6Number | Largest | Smallest 5 | 5 | 5 2 | 5 | 5 | FLargest changes only on rows where Number is strictly bigger than the stored Largest; otherwise its trace table cell is copied down unchanged. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
IF Number > Largest THEN — In a trace table, Largest only changes on rows where this test is true. If Number is equal or smaller, the Largest cell stays the same as the row above. Smallest uses < instead.IF Number > Largest THENIF Number < Smallest THENIF Number > Largest THEN
Largest ← Number
ENDIFIF Number > Largest THEN
Largest ← Number
ENDIFIF Number < Smallest THEN
Smallest ← Number
ENDIF