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 | |
|---|---|---|
| 1assert round(c * 9 / 5 + 32, 1) == 98.6 | AThe expected result was worked out wrongly. 100 plus 10% GST should be 110.0, so the test checks against the wrong value. | |
| 2print(received == displayed) | BThe expected value is produced by the program itself, not worked out by hand, so the test always passes and proves nothing. | |
| 3Work out the expected value by hand first (3 items at 4.50 = 13.50), then compare it with the program's total | CCompares the data received from the API with the data shown on screen to see if it changed on the way | |
| 4A rounding error appears when the output differs from the expected value, for example 2.5 shown as 2 | DChecks the converted temperature matches the answer worked out by hand for a known input of 37 degrees Celsius | |
| 5expected = average([70, 80, 90]) assert average([70, 80, 90]) == expected | Eexpected = 13.50 actual = total_cost(3, 4.50) print(actual == expected) | |
| 6assert price_with_gst(100) == 10.0 | Fprint(int(2.5), round(2.5, 1)) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
accuracy testing — Comparing the prototype's actual output with expected results worked out by hand from known data, to find wrong values such as rounding or conversion errors.expected = 59.97
actual = round(19.99 * 3, 2)
print(actual == expected)total = 10 / 3
shown = round(total, 2)
print(shown)expected = 212
actual = 100 * 9 / 5 + 32
print(actual == expected)received = 42.5
displayed = float("42.5")
print("Mismatch:", received != displayed)expected = 59.97
actual = 19.99 * 3
print(abs(actual - expected) < 0.01)