Repair an inclusive parking threshold
Scenario. A parking area is free for stays of 30 minutes or less. Longer stays cost 5 euros.
Inputs. Minutes Parked, a whole number from 0 through 480.
Rules and notation. Output a fee of 0 euros for 30 minutes or less and 5 euros for more than 30 minutes.
Assumptions. The input has already been checked against the stated range. No other rates or fees apply.
Deliverable. Complete the checking sequence in three phases:
- Plan. Record a purpose and expected fee for 29, 30, and 31 minutes before inspecting Listing 1.
- Trace and diagnose. Record the observed fee and verdict for each case. Identify the first mismatch and the condition that causes it.
- Repair and retest. Change only the faulty condition and repeat all three planned tests.
Success criteria. The plan contains values immediately below, at, and above the threshold. The exact-threshold test exposes the defect, the repair follows the “30 minutes or less” rule, and the neighboring cases retain their required results.
Minutes Parked < 30 to choose between a zero-euro and 5-euro fee.
TipHint
Translate the words “30 minutes or less” into one comparison.