Cover lesson · Computer Science · Year 8 · Intermediate

DIV and MOD for a quiz timer

LNF: Numeracy → Developing mathematical proficiency → Communicating with symbols

Name: Class: Date:

Cover teacher: you need no subject knowledge

What this practises: numeracy in Computer Science. Pupils use the symbols programmers use for calculations and comparisons (DIV, MOD, <>, <=, >=, AND, OR), write time with correct units and notation, and turn rules written in words into precise symbols. They correct a test log that mixes up notation. This builds towards GCSE Computer Science Unit 1, Section 1.6.1 (arithmetic, comparison and logical operators).

Print: this sheet, one per pupil, and the stimulus sheet “Cwis Cwm Ystrad: the quiz timer and the rules”, one between two. No calculators: a calculator’s divide key gives decimals, which is part of the problem. No computers are needed.

Run: 6 min read sections 1 to 4 and do Step 1 · 10 min Step 2, the timer · 6 min Step 3, hours · 12 min Step 4, rules into symbols · 10 min Step 5, Efa’s test log · 6 min Step 6 and success criteria. Total 50 minutes.

Collect: this sheet. The worked example has every answer. Checkpoints: 17 DIV 5 = 3 and 17 MOD 5 = 2; 359 seconds shows as 5:59; rule R1 is time <= 10; lines L1, L2, L3, L4 and L5 of Efa’s log have errors.

What you are doing

Efa’s quiz program thinks in seconds and needs its rules in symbols. Words such as “or less” and “every 3rd” must become exact symbols, and every answer must be written in the correct form with the correct units.

Step 1: DIV and MOD warm-up

a and ba DIV ba MOD bCheck: (a DIV b) * b + (a MOD b) = a
17 and 5
23 and 4
30 and 6
7 and 10
100 and 7

Step 2: the timer

Use Efa’s method in section 4.

time (s)time DIV 60time MOD 60In words with unitsDisplayCheck back in s
95
125252 min 5 s2:052 * 60 + 5 = 125
200
359
600

(b) Why does the display show 2:05 and not 2:5?

Step 3: hours as well

A long quiz lasts 3,725 seconds. (a) Write the three expressions Efa needs, using DIV and MOD, for the hours, the minutes left over and the seconds left over. (Hint: 1 h = 3,600 s.)

(b) Use them to write 3,725 s in h, min and s, and as a display like 1:00:00.

Step 4: rules into symbols

(a) Write each rule in section 5 as a condition using symbols. Use the names time, question, score, age, answer and correct.

RuleCondition in symbols
R1
R2
R3
R4
R5
R6

(b) Is R1 TRUE or FALSE when time is 8? 10? 12?

(c) List the question numbers from 1 to 12 that are picture rounds (R2). Show how MOD tells you.

(d) Ifan wrote R1 as time < 10. Give a value of time where Ifan’s condition gives the wrong result.

Step 5: Efa’s test log

Look at section 6. For each line, say if it is correct. If not, say what is wrong and write it in correct form.

LineCorrect?What is wrongCorrect form
L1
L2
L3
L4
L5
L6

Step 6: why symbols?

Explain why a program needs time <= 10 instead of the words “quickly” or “about 10 seconds”.

Step by step

  1. 6 min Read sections 1 to 4. Step 1: DIV and MOD.
  2. 10 min Step 2: the timer.
  3. 6 min Step 3: hours as well.
  4. 12 min Step 4: rules into symbols.
  5. 10 min Step 5: correct Efa’s test log.
  6. 6 min Step 6, then tick the success criteria you have met.

Success criteria

If you finish early