Thanks to visit codestin.com
Credit goes to github.com

Skip to content

probert999/cinnamon-cinema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cinnamon Cinema

Develop a program to allocate seats to customers purchasing tickers for a movie theatre.

Requirements

The movie theatre has 15 seats, arranged in 3 rows of 5

  • Rows are assigned a letter from A to C
  • Seats are assigned a number from 1 to 5


    As a Cinnamon Cinemas Movie Theatre Manager I want to allocate seats to customers So that I can control reserved seating for the theatre

  • GIVEN a customer wants to request some tickets
  • WHEN they request a number of seats between 1 and 3 for a movie
  • THEN the customer should be allocated the required number of seats from the available seating plan
  • AND the seats should be recorded as allocated

    Acceptance criteria

  • Write a program that allocates seats based on a random integer between 1 and 3
  • Your program should allocate the required number of seats from the available seats starting from A1 and filling the auditorium from left to right, front to back
  • All of the seats are available for sale when the program starts
  • Once there are not enough seats available to be allocated then the program can halt

    Design

    UML Class Diagram

  • BookingService - provides methods to add and retrieve movies, book seats, generate tickets and get customer list
  • Cinema - has name of cinema and generates SeatingPlan. Passed into BookingService
  • Movie - has movie details (name, time). Each movie has its own SeatingPlan
  • SeatingPlan - generates seats, maintains count and list of available seats and method to reserve seats
  • Seat - has seat row and number, allocation status and customer id (if allocated)
  • Ticket - has details of movie and seats
  • Customer - maintains list of allocated tickets

    Seat selection

    The requirement to halt on not enough seats available to be allocated needs some clarification.
    This could mean the program is halted when a customer requests 3 seats and there are only 2 remaining, or that booking remains open until the final seats are taken. The program implements the latter for commercial reasons!

    Building and Running the application

    Once cloned, the application can be built using the following Maven command:

    mvn compile package

    The unit tests will be executed as part of the build process which produces a jar file in the tagret directory.


    To run the application, from the command line, enter:

    java -jar target/cinnamon-cinema-1.0-SNAPSHOT.jar

    No user input is required.The output shows each booking request and whether it has been successful until all seats are booked. A list of customers with the seat allocation is then produced.

    Future enhancements

  • Multiple movies available for booking
  • Take into consideration the date and time of the movie
  • Different seating plan type
  • Multiple screens within the cinema
  • Improved automatic seat selection to keep customers on the same row
  • Customer selection of seats
  • Multiple customers booking at the same time (a lot to consider here!)
  • About

    Cinnamon Cinema booking task - UML, TDD, Java

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages