Write pseudocode for dependency checks and merge procedures (as used in Bayou) suitable for a simple room-booking application.

What will be an ideal response?

```
Operation: room.book(booking).
let timeSlot = booking.getPreferredTimeSlot();
Dependency check:
existingBooking = room.getBooking(timeSlot);
if (existingBooking != null) return “conflict” else return “no conflict”;
Merge procedure:
existingBooking = room.getBooking(timeSlot);
// Choose the booking that should take precedence over the other if (greatestPriority(existingBooking, booking) == booking)
then { room.setBooking(timeSlot, booking); existingBooking.setStatus(“failed”);}
else {booking.setStatus(“failed”);}
```
– in a more sophisticated version of this scheme, bookings have alternative time slots. When a booking cannot be made at the preferred time slot, the merge procedure runs through the alternative time slots and only reports failure if none is available. Similarly, alternative rooms could be tried.

Computer Science & Information Technology

You might also like to view...

=AVERAGEIFS(C2:C64,A2:A64,"Blue",B2:B64,"Black")

Returns an average of Column C of the items which are either Blue or Black. Indicate whether the statement is true or false

Computer Science & Information Technology

________ data from a permanent connection can be imported as a simple table, a PivotTable report, or PivotChart

A) Unformatted B) Static C) Formatted D) Live

Computer Science & Information Technology