Answered step by step
Verified Expert Solution
Link Copied!

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

bookings_dict 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 reservation_ID as a key, followed by a tuple of booking name, table number and whether the party is complete (with 1 indicating a complete party, 0 indicating an incomplete party)We assume that keys are returned in the order they were inserted (this is how current Python versions operate).Write a function, tables_ready, which accepts as parameters a dictionary, bookings and an integer, number_of_tables, in that order. number_of_tables 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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions