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 | |
|---|---|---|
| 1Expected: 15 | Actual: 15 | Result: Pass | AThe result is marked Pass even though the actual result (10) does not match the expected result (20). It should be Fail. | |
| 2Expected: 15 | Actual: 5 | Result: Fail | BExpected: 20 | Actual: 10 | Result: Fail | Note: added instead of multiplied | |
| 3Copy the actual result exactly as the program displayed it, including spaces, capitals and punctuation. | CThe expected result was changed to match the actual result, which hides the bug. The expected result must stay 20 and the test should be marked Fail. | |
| 4When a test fails, keep the expected result unchanged and write a note describing what went wrong. | DThe actual result matches the expected result exactly, so the test is marked Pass. | |
| 5Expected: 20 | Actual: 10 | Result: Pass | EThe actual result does not match the expected result, so the test is marked Fail and a note should be added. | |
| 6Expected: 10 (changed from 20) | Actual: 10 | Result: Pass | FActual: Total: $12.50 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Pass or Fail — Copy the actual result exactly as the program gave it, then mark Pass only if it matches the expected result, otherwise Fail. Never change the expected result to fit, and add a note for fails.expected = 5
actual = add(2, 3)
if actual == expected: print("Pass")v = "Pass" if actual == expected else "Fail"if actual != expected:
print("Fail: got", actual, "want",
expected)actual = add(2, 3)
print("Actual:", actual)expected = 5
actual = add(2, 2)
if actual != expected: print("Fail")