Worked example · Computer Science · Year 8
LNF: Numeracy → Developing mathematical proficiency → Communicating with symbols
A complete, secure Year 8 answer, annotated so you can see which success criterion each part meets. It is also the answer key. Headline answers: 95 s shows 1:35, 200 s 3:20, 359 s 5:59, 600 s 10:00; 3,725 s is 1:02:05. R1 is time <= 10 and R2 is question MOD 3 = 0. In the test log, L1 to L5 are wrong and L6 is correct. The most common mistake is treating the decimal from / as minutes and seconds (2.08 is not 2 min 8 s).
| a and b | a DIV b | a MOD b | Check |
|---|---|---|---|
| 17 and 5 | 3 | 2 | 3 * 5 + 2 = 17 |
| 23 and 4 | 5 | 3 | 5 * 4 + 3 = 23 |
| 30 and 6 | 5 | 0 | 5 * 6 + 0 = 30 |
| 7 and 10 | 0 | 7 | 0 * 10 + 7 = 7 |
| 100 and 7 | 14 | 2 | 14 * 7 + 2 = 100 |
7 DIV 10 = 0 and 7 MOD 10 = 7 are the tricky ones: 10 goes into 7 no whole times, so all 7 is left over. Evidences criterion 1.
| time (s) | DIV 60 | MOD 60 | In words | Display | Check |
|---|---|---|---|---|---|
| 95 | 1 | 35 | 1 min 35 s | 1:35 | 1 * 60 + 35 = 95 |
| 125 | 2 | 5 | 2 min 5 s | 2:05 | 2 * 60 + 5 = 125 |
| 200 | 3 | 20 | 3 min 20 s | 3:20 | 3 * 60 + 20 = 200 |
| 359 | 5 | 59 | 5 min 59 s | 5:59 | 5 * 60 + 59 = 359 |
| 600 | 10 | 0 | 10 min 0 s | 10:00 | 10 * 60 + 0 = 600 |
(b) The seconds part is always shown as 2 digits, because 2:5 could be misread as 2 min 50 s. The 0 in 2:05 holds the tens place.
Every result is checked by reversing it. Units are written with a space and the display has none. Evidences criteria 1, 2 and 5.
(b) 3725 DIV 3600 = 1. 3725 MOD 3600 = 125, and 125 DIV 60 = 2. 3725 MOD 60 = 5. So 3,725 s = 1 h 2 min 5 s, displayed as 1:02:05. Check: 3,600 + 120 + 5 = 3,725.
Brackets show the order: find what is left after the hours first, then divide that by 60. Evidences criteria 1 and 5.
| Rule | Condition |
|---|---|
| R1 | time <= 10 |
| R2 | question MOD 3 = 0 |
| R3 | score >= 50 OR time > 600 |
| R4 | age >= 11 AND age <= 14 |
| R5 | answer <> correct |
| R6 | question MOD 2 = 0 |
(b) time = 8: TRUE. time = 10: TRUE (“or less” includes 10). time = 12: FALSE.
(c) Questions 3, 6, 9 and 12. For these, question MOD 3 = 0 because 3 goes in exactly with nothing left over. For example 9 MOD 3 = 0, but 10 MOD 3 = 1.
(d) time = 10. The rule says 10 seconds should get the bonus, but 10 < 10 is FALSE, so Ifan’s condition gives no bonus.
“Or less” becomes <=, “or over” becomes >=, and “more than” becomes >. The pupil tests the boundary value, 10, which is where mistakes show. “Every 3rd” is turned into MOD. Evidences criterion 3.
| Line | Correct? | What is wrong | Correct form |
|---|---|---|---|
| L1 | No | 2.08 is 2.08 minutes, not 2 min 8 s. The decimal part is a fraction of a minute. | 125 DIV 60 = 2, 125 MOD 60 = 5, display 2:05 |
| L2 | No | DIV only gives the whole-number part. “r 20” is not part of DIV. | 200 DIV 60 = 3 and 200 MOD 60 = 20 |
| L3 | No | Mixes a display with a unit. 5:59 min looks like a decimal of minutes. | 359 s = 5 min 59 s (display 5:59) |
| L4 | No | 60 goes into 600 exactly, so the remainder is 0. 10 is the DIV answer. | 600 MOD 60 = 0 (and 600 DIV 60 = 10) |
| L5 | No | =< is not a symbol. The characters are in the wrong order. | time <= 10 |
| L6 | Yes | Correct units and spacing. |
Each correction says what the error is, not just the right answer. Evidences criterion 4.
A program cannot decide what “quickly” or “about 10 seconds” means, and two people might disagree about 11 seconds. time <= 10 has exactly one meaning: 10 and below get the bonus, and everything above does not.