Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download|: http://solutionzip.com/downloads/cinema-ticket-booking-application-java/
- Brief:
- You will individually develop a Cinema Ticket Booking Application in Java with the following functionality, available from the console:
- • Requests the Customer’s name, age and asks if they are a student
- • Lists films that are currently available to watch at the cinema
- • Asks the customer to select the film to watch from a menu
- • Issues a ticket if age appropriate
- • Calculates the cost of the ticket and prints the ticket details to the console with the customers details, the film’s detail and the cost
- Methodology and Marking Scheme:
- You will develop five classes with the following instance variables and methods
- • Film class
- • Stores the title of a film and the rating of the film
- • Has a constructor with inputs for film title and rating
- • Has a default constructor with suitable default values
- • Has appropriate data encapsulation methods
- • toString method returns a string representation of a Film object
- • Customer class
- • Stores the customer’s name, age, and if they are currently a student
- • Has a constructor with inputs for name, age and student
- • Has a default constructor with suitable default values
- • Has appropriate data encapsulation methods
- • toString method returns a string representation of a Customer object
- • RATING enumerated type
- • Has elements corresponding to New Zealand’s film rating systems:
- o General, films appropriate for all ages o Parental Guidance, ages 12 and above o Mature, ages 16 and above
- • Has an instance variable storing the minimal age for the film rating
- • Has a constructor with input for minimal age
- • Ticket class
- • Stores a Customer object and Film object
- • Has a method double cost() which calculates ticket cost as follows:
- o Standard ticket for adults: (aged 18 years or more) $10
- o Standard tickets for children: (aged less than 18 years) $7
- o Students between the ages of 10\25 have a 15% discount of their ticket
- o Students above 25 have a 10% discount off their ticket
- o Seniors (above the age of 64) and are not students have a 7% discount from the cost of their ticket
- • Has a constructor with inputs for Customer and Film
- • Is immutable but has appropriate get methods
- • toString method returns a string representation of the printed ticket with details for customer and film and total cost, with correct decimal format for currency
- • CinemaTicketBookingApplication class
- • static (e.g. class) variables for: keyboard input, a primitive array of Film objects and a constant NUMBER_OF_FILMS that specifies the size of the array
- • static main method initialises a primitive array of films (these may be hard\coded) and repeatedly issues tickets in the following manner:
- o invokes the method private static Customer customerDetailsInput() which prompts the user to enter their customer information, constructs and returns a Customer object
- o invokes the method private static Film filmSelection() prompting the user to type the number corresponding to the film they want to watch, returning the appropriate Film object
- o public static Ticket issueTicket(Customer aCustomer, Film aFilm) which constructs and returns a Ticket object if the customer’s age is appropriate to the film they wish to view. If not, null is returned and the customer is advised that the purchase could not be completed.
- o The Ticket is issued (e.g. displayed to the console) and the customer is asked if they wish to purchase another ticket
- Sample Usage of CinemaTicketBookingApplication:
- Welcome to the Cinema Ticket Purchasing System Please enter your name:
- Jack Smith
- Please enter your age: 20
- Are you a student? (Y/N) Y
- Which film would you like to watch:
- 1 Ant-Man rating: (P)
- 2 Minions rating: (P)
- 3 Jurassic World rating: (M)
- 4 Inside Out rating: (G) 1
- Your ticket is ready to be collected!
- ————————————————————
- FILM TICKET for: Ant-Man rating: (P)
- CUSTOMER DETAILS: Jack Smith age: 20 Student? Yes TOTAL COST: $8.50
- ————————————————————
- Issue another ticket? (Y/N) Y
- Please enter your name: Holly Day
- Please enter your age: 10
- Are you a student? (Y/N) Y
- Which film would you like to watch:
- 1 Ant-Man rating: (P)
- 2 Minions rating: (P)
- 3 Jurassic World rating: (M)
- 4 Inside Out rating: (G) 3
- Sorry, cannot issue ticket for age restricted film Issue another ticket? (Y/N)
- N
- Download|: http://solutionzip.com/downloads/cinema-ticket-booking-application-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement