In: Electrical Engineering
A movie theater is planning to offer the possibility to book the seats either online or at the kiosk of the theater. Design the booking application for the theater taking in account the following consideration:
- The theater has 100 seats only.
- More than one user may be trying to book the same seat at the same time.
- Any seat can be booked by only one user.
- A seat can be available for the kiosk agent and the online user at the same time but can be booked by only one of them.
- If the client did not book a seat online or changed his/her mind at the kiosk, the seat must be available again for booking.
Use the process synchronization techniques. You are allowed to use variables as much as you need in the design.
The code does not have to be complicated or detailed. Thanks for the help!