Question
def get_order(day, start_hr, start_min, num_children, num_adults, num_hours): This function accepts the day of the week, the start starting time (in hours and minutes), the number
def get_order(day, start_hr, start_min, num_children, num_adults, num_hours): This function accepts the day of the week, the start starting time (in hours and minutes), the number of people (children and adults) and the total number of hours they spent. It then determines what the groups total bill is and returns the line to be printed at the bottom of their receipt (as a string, defined below). The string messages are relatively short, but we need to exactly match the formatting.
Return value: a string indicating how much is owed; X is the actual dollar amount (should always be an int); all valid return values will match one of these patterns:
o "Afternoon special! Total: $X." (Afternoon Special)
o "Kids eat free special! Total: $X." (Kids Eat Free Special)
o "Tuesday afternoon, best deal! Total: $X." (both K-E-F and Afternoon special apply)
o "Total: $X." (other cases)
Assumptions
o num_hours is always a positive integer.
o day, start_hr, start_min all have the same assumptions as check_special_time().
o num_children and num_adults all have the same assumptions as get_hour_cost().
Notes:
o Make sure to return a string, not print a string.
o The Kids Eat Free special is available all day on Tuesday.
o Do not copy and paste the code from the other functions you wrote, call the functions instead!
Examples
o get_order(1, 21, 0, 0, 1, 1) "Total: $20"
o get_order(1, 14, 1, 0, 1, 2) "Afternoon special! Total: $32"
o get_order(2, 12, 0, 0, 9, 1) "Kids eat free special! Total: $180"
o get_order(2, 16, 29, 0, 2, 2) "Tuesday afternoon, best deal! Total: $64"
o get_order(2, 14, 0, 1, 1, 1) "Tuesday afternoon, best deal! Total: $20"
python language please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started