Show Booking system implemented in Java
This project contains the following java files:
com.booking.cinema
Shows.java CancellationWindow.java Rows.java Seats.java Tickets.java
Shows.java is the major object which handle most of the logic flow, including booking/canceling and displaying A new Shows object would comprises of:
- Rows
- Seats
- Buyers (including the tickets they bought)
- Cancellation Window
- Seat availability
CancellationWindow.java handles the cancellation window timer. It initiates after a Ticket is purchased.
Rows.java handles the row dimension of the Shows object (maximum 26, from A to Z)
Seats.java handles the Seats dimension of the Shows object (maximum 10, from 1 to 10)
Tickets.java object initiates after a ticket is purchased. It handles the unique ticket number generation and also keep tracks of the cancellation timer.
com.booking.person
Admin.java Buyer.java
Admin can perform two action:
- Setup
- View
There's only one Admin and it's created as a new static instance everytime you invoke RunThis.java
Buyer can perform three action:
- Availability
- Book <Phone#>
- Cancel <Ticket#> <Phone#>
You can have as many Buyer you want, as long as you supply with different Phone# every single booking
com.booking.util
PropertiesConstant.java StringUtil.java
com.booking.runthis
RunThis.java
RunThis is the executable to be run. refer to #To run the code# below for more info.
#To run the code
- Clone the project into your folder
- navigate to /src folder
- compile the code based on the OS you are on
$ find -name "*.java" > sources.txt
$ javac @sources.txt
dir /s /B *.java > sources.txt
javac @sources.txt
- Invoke RunThis.java via the following:
java com.booking.runthis.RunThis
- The following will appear:
Please enter your data below: (send 'bye' | 'quit' | 'exit' to exit)
For usage:
---Admin---
Admin Setup
Admin View
---Buyer---
Buyer availability
Buyer book
Buyer cancel
- The program is now up and running, you may test out the features. Use 'bye' | 'quit' | 'exit' to exit
- Assume max seats per row is 10 and max rows are 26. Example seat number A1, H5 etc.
- Rows cannot be added beyond the upper limit of 26.
- Rows.java and Seats.java can be invoke without any size (i.e. new Rows() and new Seats()), which will auto default to the maximum 10 and 26
- After booking, User can cancel the seats within a time window of (configurable via Admin Setup). Cancellation after that is not allowed.
- Only ONE booking per phone# is allowed per show.
- There's only one Admin, and each new Show created will be stored in the admin object during invocation of RunThis.java
- You can have as many Buyer you want, as long as you supply with different Phone# for every single booking