Question: A central computer connected to remote terminals via communication links is used to automate seat reservations for a concert hall. A booking clerk can
A central computer connected to remote terminals via communication links is used to automate seat reservations for a concert hall. A booking clerk can display the current state of reservations on the terminal screen. To book a seat, a client chooses a free seat and the clerk enters the number of the chosen seat at the terminal and issues a ticket. A system is required which avoids double bookings of the same seat whilst allowing clients free choice of the available seats.A model given below is designed for the concert hall reservation system. However, the model sometimes double books tickets. Please modify the following model to avoid double booking. Note: Please do not repeat the parts that remain the same. Just write down the modified part. const False = 0 const True = 1 range Bool = False.. True SEAT SEAT [False], SEAT [reserved: Bool] = (when (!reserved) reserve -> SEAT [True] query [reserved] -> SEAT [reserved] when (reserved) reserve -> ERROR range Seats = 1..4 | | SEATS = (seat [Seats]: SEAT). TERMINAL = (choose [s: Seats]-> seat [s].query [reserved: Bool] -> if (!reserved) then (seat [s].reserve -> TERMINAL) else TERMINAL set Terminals = {a,b) || CONCERT = (Terminals: TERMINAL || Terminals::SEATS ). //error of reserved twice
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
const False 0 const True 1 range Bool False True SEAT SEAT False SEAT reserved Boo... View full answer
Get step-by-step solutions from verified subject matter experts
