Step 1: Phase 1: Every order
Phase 1: Every order
Boss rules. One file, till.py. The output must match exactly. From Phase 2 on, the check plays
whole days you can't see and tells you how many reports came out right, and what the first wrong
one should have been. The hint nudges; it won't write the till for you.
The till. Friday is the busiest day at Bean There. Every order is an hour and a number of flat
whites: the till asks Hour: , then Cups: , then the same for the next order, until Sam types
close instead of an hour. Then it prints the day:
Today: 8 orders, 19 cups, £55.90
A cup costs FLAT_WHITE, and in happy hour, 15:00 up to 17:00, HAPPY_PRICE. With exactly one
it's 1 order and 1 cup. A day nobody came prints Today: 0 orders, 0 cups, £0.00.
Press Run to play Friday's first eight orders (friday.py types them in), or type
python3 till.py in the terminal and take orders yourself. The check plays that Friday, a day with a
single order and a day nobody came.
till.py, the file you edit7 lines
# Bean There's till, Level 3: the Friday rush. Prices are in whole pennies.
FLAT_WHITE = 320
HAPPY_PRICE = 250 # a flat white in happy hour, 15:00 up to 17:00
# Your till: take the day's orders one at a time. Each order is an hour and a number of cups,
# asked as "Hour: " and then "Cups: ". When Sam types close instead of an hour, the day is over:
# print the report in the brief.provided for you:friday.py