Worked example · Computer Science · Year 11
LNF: Literacy → Writing → Proofreading, editing and improving
A complete, secure Year 11 answer, annotated so you can see which success criterion each part meets. It is also the answer key. The bug: line 4 uses age > 65, so a 65-year-old pays £8.50; it should be age >= 65. This is a logic error, not a syntax error, because the program runs. The most common weaknesses in redrafts are keeping “it works now” without evidence, and keeping the untrue claim that the program “has no bugs”.
| Age | 11 | 12 | 64 | 65 | 66 |
|---|---|---|---|---|---|
| Price given | £5.50 | £8.50 | £8.50 | £8.50 | £6.00 |
| Correct? | Yes | Yes | Yes | No, should be £6.00 | Yes |
(b) Line 4, elif age > 65:, should be elif age >= 65:, because the brief says “65 and over”.
| Ifan wrote | Code | Correction |
|---|---|---|
| didnt (sentence 1) | P | didn’t (apostrophe for the missing o) |
| it didnt work (1) | V | Test 4 failed: the program gave the wrong price for age 65. |
| their was (2) | Sp | there was |
| sintax error (2) | Sp and T | Spelled syntax, but the right term is logic error: the program ran. |
| should of been (3) | G | should have been |
| the thing on line 4 (4) | V | the comparison operator > in the condition on line 4 |
| tested it again and it works now (5) | E and G | Which tests, with what results? Tense changes from past to present. |
| crashs (6) | Sp | crashes |
| it crashs, I dont no why (6) | P and Sp | Comma splice: use a full stop. don’t know. Also name it: a runtime error (ValueError). |
| progam (7) | Sp | program |
| has no bugs (7) | H | Not true: test 6 still fails. |
The pupil works sentence by sentence and finds more than 10 problems, and separates surface errors (spelling, punctuation) from deeper ones (wrong term, no evidence, untrue claim). Evidences criteria 1, 2 and 4.
| Ifan wrote | Precise version |
|---|---|
| it didnt work | Test 4 (boundary data, age 65) failed. |
| a sintax error on line 4 | a logic error in the condition on line 4 |
| I changed the thing on line 4 | I changed the comparison operator on line 4 from > to >= |
| it works now | tests 1 to 5 now pass |
| when you type a word it crashs | entering a word causes a runtime error (ValueError), because int() cannot convert text such as “ten” to a number |
Evidences criterion 2.
| Part | Sentences | What is missing |
|---|---|---|
| What went wrong and why | 1, 2, 3 | The expected and actual result in one place; the correct type of error; why > excludes 65. |
| What I changed | 4 | The exact change: > to >=. |
| How I retested, and what still needs work | 5, 6, 7 | Which tests were rerun and their results; an honest note that test 6 still fails. |
Evidences criterion 3.
What went wrong. Test 4 used boundary data: an age of 65. The brief says customers aged 65 and over pay £6.00, but the program output £8.50. This was a logic error, not a syntax error, because the program ran without stopping. The condition on line 4, age > 65, is only True for ages above 65, so a customer aged exactly 65 fell through to the else branch.
What I changed. I changed the comparison operator on line 4 from > to >=, so the condition became age >= 65.
How I retested. I reran all six tests. Test 4 now outputs £6.00 as expected, and tests 1, 2, 3 and 5 still pass. However, test 6 still fails: entering “ten” causes a runtime error (ValueError) because int() cannot convert text. The program therefore needs input validation before it is finished.
The three parts answer what went wrong, what changed and how it was retested. Every claim has evidence, the technical terms are correct, and the final paragraph is honest about test 6. The past tense is used for actions and the present tense for what the code does now. Evidences criteria 1 to 4.
Partner’s comment: “Your first paragraph says the result was wrong but not what price it gave. Add the actual output.”
Response: “I added ‘but the program output £8.50’, so the reader can compare the expected and the actual result without looking at the table.”
The response names the exact change and why it helps the reader. Evidences criterion 5.