Quiz — Lecture 05

Section A from memory, one line each. Section B shows your reasoning - marks are for method, not final answers. Answers are discussed in class; the exit ticket goes on a card.

Section A

A1. What do n % 10 and n // 10 give, always?

A2. A duty roster cycles through 5 people starting with person 1 on day 1. Who has day 47?

A3. State the divisibility-by-3 rule and verify on 4723.

A4. What is the off-by-one risk in cycle maths?

Section B

B1. Trace the digit-peel loop for 4723: list each step's digit and remaining number.

B2. With weekend-skip (Mon-Fri duty only), what must change in the pager formula?

Exit ticket

Answer one of these on your card in 60 seconds (choose any one):

  1. Compute 17 mod 5 and 17 // 5, and say what each means for a 5-day cycle.
  1. Why is remainder better than an if-chain for schedules?
  1. What replaced a loop in the Josephus analysis?

Homework