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: 4 and 6 | AIt is wrong because total was not set to 0 first. | |
| 2Expected: 10, Actual: 14 | BRow 1: total shows 4 but should be 0 + 4 | |
| 3Point to the trace row where the value first goes wrong, as evidence from the trace table | CToo vague. It gives no input, no expected or actual output and no trace row. Fix it by naming all of these. | |
| 4Explain the cause to a classmate using a because sentence | DThe correction does not say which step to change or what to change it to. Fix it by naming the step and the new version. | |
| 5Bug: my algorithm does not work. | EStates the input used when the test was run | |
| 6Row 3 is wrong. Fix: change the code. | FCompares the expected output with the actual output |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
bug report — A short note giving the input used, the expected and actual output, the trace row where it goes wrong, the cause and the correction. Use 'because' to explain the cause to a classmate.Input used: 4
Expected output: 10
Actual output: 14Input used: 4
Expected output: 10
Actual output: 14Input used: 4, expected output: 10
Evidence: the trace table, row 3, total = 14Row 3: total = 14, expected 10
Cause: total is wrong because it starts at 4Cause: total starts at 4, not zero
Fix: add total ← 0 before the loop