Skip to content

Show Booking system implemented in Java, runs via command prompt

License

Notifications You must be signed in to change notification settings

freddusya/ShowBooking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShowBooking

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:

  1. Rows
  2. Seats
  3. Buyers (including the tickets they bought)
  4. Cancellation Window
  5. 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:

  1. Setup
  2. 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:

  1. Availability
  2. Book <Phone#>
  3. 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

  1. Clone the project into your folder
  2. navigate to /src folder
  3. compile the code based on the OS you are on

Linux / MacOS

$ find -name "*.java" > sources.txt

$ javac @sources.txt

Windows

dir /s /B *.java > sources.txt

javac @sources.txt

  1. Invoke RunThis.java via the following:

java com.booking.runthis.RunThis

  1. 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


  1. The program is now up and running, you may test out the features. Use 'bye' | 'quit' | 'exit' to exit

Assumptions/Constraints:

  1. Assume max seats per row is 10 and max rows are 26. Example seat number A1, H5 etc.
  2. Rows cannot be added beyond the upper limit of 26.
  3. 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
  4. After booking, User can cancel the seats within a time window of (configurable via Admin Setup). Cancellation after that is not allowed.
  5. Only ONE booking per phone# is allowed per show.
  6. There's only one Admin, and each new Show created will be stored in the admin object during invocation of RunThis.java
  7. You can have as many Buyer you want, as long as you supply with different Phone# for every single booking

About

Show Booking system implemented in Java, runs via command prompt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages