Problem

You are a programmer working in a software development company servicing mostly SME clients. You just received a new project to write a program that can be used to assign and book seats for a commercial cinema.

The cinema has 16 rows, with 20 seats in each row. The seats at the mid-column (number 5 to 15) of the last 2 rows closest to the doors (row A and B) are Twin seats, which will be sold in pair, side by side (e.g., buy A5 means paying for both A5 and A6). The rest of the seats in the row A and B, and all seats in row C to F are Premiere seats. Row G to L are Gold seats, and row M to Z are Economy seats. The map of the cinema is shown in Figure 1. The prices of the seats are shown in Table 1. See image. Seat pricing, see image.

Questions

Write a program that can be used to assign seats for the cinema. The following briefly describes the Seat Assignment function of such program. Initially, your program prompts the seating plan to the operator in the following format: See image.

Here, * indicates that the seat is available; x indicates that the seat is unavailable (sold out); o indicates that the seat is reserved (without payment). Your program prompts the operator to enter the following information:

  • Number of seat required
  • Desired seat category (Twin, Premiere, Gold or economy)

Upon entering the information, the program is to list the available seats matched with the requirements. The list contains the available seats located side by side, in the same row and column that will meet the number of seat required. The list is shown with the starting seat number and the number of seat available after the seat. The operator can then choose to update the status of the seat. For example, See image.

Your program then output the seating plan to the operator with updated information, as shown in the following. See image.

If there is no available seat in a row to match the required number of seat, the operator should break down the number to 2 smaller numbers so that customers are to be seated in separate rows.

After some time you might have this output in the seating plan: See image.

Your program will output as the following: See image.

Notice the changes in the seating plan and the number of seats available. However, there is no payment received for the reserved seats and hence no change in the total sales value. The reserved seats will be changed into unavailable after payments are received.

Your program will block any attempt to change unavailable seats into reserved or available seat status.

The above described only the functions of your program under the Seat Assignment menu. The complete program should be menu-driven with the following choices:

  • Seat Assignment
  • Payments (for reserved seat)
  • Reset Seating Plan
  • Exit

With the Payment menu available, your program will allow the operator to change the reserved seats to available seats, considering all reserved seats will expired eventually if payment is not received after some time.

Your project 1 and 2 for TCP1231 are to write a program for the problem above. You are to make 2 submissions (one for Project 1 and one for Project 2) of your program according to the deadlines, each meeting the minimum requirements as described below.

The evaluations of the projects are based on the marking schemes and are attached with this document. Note: Both Project 1 and Project 2 can be individual or group projects. Maximum 2 person per group from the same tutorial session is allowed.

Project 1

You are to write a program for only the seat assignment menu described above. You need to utilise all the programming techniques covered by the lectures, tutorials and labs up to week 7.

You will only program for the Seat Assignment function. Your program will:

  • Display the seating plan.
  • Change the seat status as entered by the operator. Leave out the functions/features that you are unable to program. For example, if you have difficulty to list out all the available seats, and/or to be specific about the seat category, and/or let the operator change several seats at a time, you can opt for changing the seat status by its name only, one by one, without the list. Submit a program able to do minimum functions is better than no submission at all.
  • Update the number of seat available and total sales value.

Project 2

You are to write a complete program for the cinema described above, including and not limited to:

  • Seat Assignment
  • Payments (for reserved seat)
  • Reset Seating Plan
  • Exit

You need to utilise all the programming techniques covered by the lectures, tutorials and labs up to week 11.

You are free to provide extra features of your choice in your program for extra marks. Some of them are as following:

  • Shows the seating plan in different colours according to the seat category.
  • Automatically saves seating plans in text files upon exit, and be able to reload the seating plans from the files the next time you run the program.
  • Different ticket prices on different day of the week. For example, some cinema have lower ticket price on Wednesday and higher on weekends.
  • Multiple seating plans for multiplex.
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.