Case-based lecture: you attempt, we discuss, then we reveal.
cs-009, cs-010, cs-144, cs-011, cs-012Picnic decision: go if temperature is 18-28 and no rain; if rain but warm, go with a tent; otherwise cancel. Flowchart it, then trace three days.
Expected: go / go with tent / cancel
Cost: Constant; the lesson is diamond wiring, not cost.
Cash machine: allow withdrawals while the balance lasts and at most 3 per session; refuse amounts over balance without ending the session.
Expected: refused / balance 30
Cost: O(requests). The flowchart question: draw where the 'refused' arrow re-enters.
A dispatch system processes queued jobs; every processed job may enqueue 0-2 smaller sub-jobs. Flowchart the loop and argue it terminates.
Expected: all dispatched
Cost: O(total size). This is the first occurrence of 'the loop ends because something provably shrinks'.
Number game: the program holds a secret 1-50; the player guesses; feedback 'higher'/'lower'/'correct'. Flowchart the game loop including a maximum of 7 guesses.
rain = True
tent = False
if rain:
if tent:
print("go with tent")
else:
print("cancel")
else:
print("go")Expected: higher / lower / correct
Cost: At most 7 feedback rounds by the rules; a halving strategy needs ceil(log2(50)) = 6.
Draw a flowchart for an ATM session: PIN with three attempts, then a menu (balance, withdraw, quit) with a balance check on withdrawal.
**Input:** PIN 1234; tries allowed 3; balance 250; withdraw 300 then 100**Output:** fail, fail, fail -> card retained; alternative: 1 fail then withdraw 300 refused, 100 acceptedSolve for the worked instance first. Then ask what would change if onenumber, name, or condition were replaced by something stranger.Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.
Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-009 — not embedded in this deck.
A garden watering system turns on based on rain sensor, time of day, and soil moisture. Build the decision flowchart and simplify redundant branches.
**Input:** rain no, 14:00, moisture 22% (threshold 30%)**Output:** water on (dry soil overrides afternoon ban); rain yes -> off regardlessSolve for the worked instance first. Then ask what would change if onenumber, name, or condition were replaced by something stranger.Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.
Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-010 — not embedded in this deck.
The careers office wants an automated reply for internship posts. Two staff members wrote requirement notes:
**Input:** the two requirement notes, the three sheet types**Output:** the disagreement identified (applications listing alanguage *and* only-beginner-tools is impossible; the conflict is'lists something non-language, non-tool'), one question, onePseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.
Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-144 — not embedded in this deck.
A delivery scooter loops: take next order, deliver, return. Model it as a flowchart with a clear termination condition and what happens when orders run out mid-shift.
**Input:** orders [A, B, C] then shift ends; new order arrives at the last minute**Output:** A, B, C delivered, then 'shift closed' - the late order is queued for tomorrow, never processed mid-loopSolve for the worked instance first. Then ask what would change if onenumber, name, or condition were replaced by something stranger.Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.
Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-011 — not embedded in this deck.
A number-guessing game with 'higher/lower' feedback. Flowchart the loop and argue how many attempts it can take before the loop must end.
**Input:** secret 73, range 1..100; guesses 50 (low), 87 (high), 68 (low), 74 (high)**Output:** 6 guesses or fewer always suffice for 1..100 (ceil(log2 101) = 7, achieved 6 here)Solve for the worked instance first. Then ask what would change if onenumber, name, or condition were replaced by something stranger.Pseudocode, flowchart or Python. State one assumption. Compare with your neighbour at minute 4.
Instructor: the reveal, the reasoning section and common wrong turns are in the instructor distribution for cs-012 — not embedded in this deck.