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 | |
|---|---|---|
| 1Input 45, expected 'Pass', actual now 'Pass' | Ascore | passed | OUTPUT 45 | Yes | Pass | |
| 2New trace table: score 50, 49, 100 | BTest 1: score 80 -> expect Pass Test 2: score 20 -> expect Fail | |
| 3Start a fresh trace table for the same failing input after the fix, and fill it in again from the first step | CRe-tracing with the same input that failed shows the fix worked: the actual output now matches the expected output. | |
| 4Test the other paths too: use one input for the IF branch and one for the ELSE branch | DTrace the corrected algorithm with other inputs too, so every path is tested and the fix did not create a new error. | |
| 5Fix made: changed > to >=. Only re-traced the other inputs, not the failing one. | EOnly one input and one path was checked. Test the other paths too, to make sure the fix did not create a new error. | |
| 6Fix made. Traced score 50 only. Output is correct, so the algorithm is finished. | FThe original failing input was not traced again, so you cannot be sure the fix solved that error. Re-trace the same failing input first. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
re-trace — After a fix, trace the algorithm again with the same failing input, then other inputs, to check the output now matches what was expected.IF mark >= 50 THEN OUTPUT "Pass"
ELSE OUTPUT "Fail"INPUT n
REPEAT n TIMES
OUTPUT "Hi"IF age >= 13 AND age <= 18 THEN
OUTPUT "Teen"
ENDIFIF score > 50 THEN OUTPUT "Pass"
ELSE OUTPUT "Fail"average ← total / count
OUTPUT average