Question: The code below extends the Bookings class by adding a method which, for a given reservation ID, will set the party complete value to 1

The code below extends the Bookings class by adding a method which, for a given reservation ID, will set the party complete value to 1 or 0 if a party becomes complete or incomplete. The code below creates a number of bookings, assigns each with an initial completeness status, and checks the completeness status of one of them, then changes its completeness status, and checks it again. class BookingsExtended(Bookings): ""Extends the class Bookings to include a party_complete status. "n" def set_completeness(self, reservation_ID: int, party_complete: int) -> None: "n"Set the party_complete to complete (1) or incomplete (0). "n" for index in range(self.bookings.length()): booking = self.bookings.get_item(index) if booking[0] == reservation_ID: booking = (booking[0], booking[1], booking[2], party_complete) self.bookings.set_item(index, booking) TestQueue = BookingsExtended () TestQueue.add_booking(24, 'Howson ', 11) TestQueue.set_completeness (24,1) TestQueue.add_booking(25, 'Linson ', 12) TestQueue.set_completeness (25,0) TestQueue.add_booking(26, 'Wermelinger', 13) TestQueue.set_completeness(26,0) TestQueue.add_booking(27, 'Hackett ', 14) TestQueue.set_completeness (27,1) TestQueue.add_booking(28, 'Evans ', 15) TestQueue.set_completeness(28,0) TestQueue.add_booking(29, 'Quinn ', 16) TestQueue.set_completeness (29,1) print(TestQueue.get_party_complete(24)) TestQueue.set_completeness (24,0) print(TestQueue.get_party_complete(24)) Add four different test cases to the table below to thoroughly test the method using the data as entered above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
