Quiz — Lecture 14
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 two parts does a function contract have?
A2. Why prefer return over print inside helpers?
A3. What is a pure helper?
A4. Name one benefit of decomposition beyond reuse.
Section B
B1. Write the contract (PRE/POST) for a phone-number validator.
B2. The log-parsing monolith: name the three functions you would extract and each one's single job.
Exit ticket
Answer one of these on your card in 60 seconds (choose any one):
- What makes a function name good?
- Why are mutable defaults dangerous?
- What does 'refactor without behaviour change' demand?
Homework
- Before: skim the four student pages; attempt case 1 on paper.
- After: write a five-line pseudocode solution for any case you did not
- Enrichment (optional): the stretch question on each case page.