An aircraft has 200 seats; each row has 4 seats with an isle in the middle. In other words, two seats on the left side of the airplane, a space, and then two seats on the right side of the airplane. There are 50 rows. Seat reservation is problematic because multiple users attempt to reserve seats at the same time and they are not aware of one another. Obvious conflicts can occur, for example, two users attempting to reserve the same seat at the same time. For this question you will implement three threads that will attempt seat reservations. These threads will represent brokers who provide this service to customers. Two threads will be automated producer functions that randomly attempt seat reservations. The third producer will not be automated; instead it is a GUI Swing form that you will use to make manual reservations, as the third broker. Each producer has an ID number: 1, 2, and 3. These ID numbers will be recorded with the seat reservation so that we can know which producer did what. The GUI displays the airplane seats together with the producer ID number and if the seat is available.

To do this you have two choices:

  • Choice 1- draw a white box for each seat. An empty white box means the seat is available. A successfully reserved seat will have the producer's ID number written within the box.
  • Choice 2- print a string of underline characters (IE. _ ) for each empty seat. Overwrite the underline with the producer's ID number to indicate that it is taken. Use the row and column number method to identify which seat you are interested in.

To summarize, this swing GUI displays the reservation form and the airplane seating availability diagram.

Whatever the choice may be, Javadoc must be used to both comment the source code and generate an HTML document describing the program

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.