Design the program top-down: first write main in terms of methods that do not exist yet, then implement each method.
A campus car park charges: the first 30 minutes free, then 5 yuan per started hour, at most 40 yuan per day. Write ParkingFee with constants and the static methods toMinutes("08:45"), parkedMinutes(in, out), fee(minutes) and duration(minutes) → 2h05.
main reads lines plate in out until the end of input and prints one line per car (%-8s %s %3d yuan), skipping cars whose exit is before the entry (B777: invalid times), then:
Cars: 3, income: 50 yuan
Longest stay: A123 (9h10)