Answered step by step
Verified Expert Solution
Question
1 Approved Answer
bookings _ dict is a dictionary exported from the BookingsLargerGroups class above. This has been provided in case your code above did not work. The
bookingsdict is a dictionary exported from the BookingsLargerGroups class above. This has been provided in case your code above did not work. The dictionary has the reservationID as a key, followed by a tuple of booking name, table number and whether the party is complete with indicating a complete party, indicating an incomplete partyWe assume that keys are returned in the order they were inserted this is how current Python versions operateWrite a function, tablesready, which accepts as parameters a dictionary, bookings and an integer, numberoftables, in that order. numberoftables indicates the number of table available to be filled. The function should return the name of the most appropriate person to call. The most appropriate person to call is always the one with the lowest booking reference whose party is complete and who needs no more than the number of tables available. If there is no suitable person to call, then the function should return an empty string. For the purposes of this question you should ignore the requested table number. You can also assume that all entries for a given name will have the same party complete value and that all given names are unique this is a simplification; the module team is aware that all given names may not be unique In the example below all Howson's are incomplete, all Hackett's are complete.
bookingsdict is a dictionary exported from the BookingsLargerGroups class above. This has been provided in case your code above did not work. The dictionary has the reservationID as a key, followed by a tuple of booking name, table number and whether the party is complete with indicating a complete party, indicating an incomplete partyWe assume that keys are returned in the order they were inserted this is how current Python versions operateWrite a function, tablesready, which accepts as parameters a dictionary, bookings and an integer, numberoftables, in that order. numberoftables indicates the number of table available to be filled. The function should return the name of the most appropriate person to call. The most appropriate person to call is always the one with the lowest booking reference whose party is complete and who needs no more than the number of tables available. If there is no suitable person to call, then the function should return an empty string. For the purposes of this question you should ignore the requested table number. You can also assume that all entries for a given name will have the same party complete value and that all given names are unique this is a simplification; the module team is aware that all given names may not be unique In the example below all Howson's are incomplete, all Hackett's are complete.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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