Advertisement
akosiraff

Cinema Ticket Booking Application JAVA

Aug 10th, 2015
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1.  
  2. Download|: http://solutionzip.com/downloads/cinema-ticket-booking-application-java/
  3. Brief:
  4. You will individually develop a Cinema Ticket Booking Application in Java with the following functionality, available from the console:
  5. • Requests the Customer’s name, age and asks if they are a student
  6. • Lists films that are currently available to watch at the cinema
  7. • Asks the customer to select the film to watch from a menu
  8. • Issues a ticket if age appropriate
  9. • 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
  10. Methodology and Marking Scheme:
  11. You will develop five classes with the following instance variables and methods
  12. • Film class
  13. • Stores the title of a film and the rating of the film
  14. • Has a constructor with inputs for film title and rating
  15. • Has a default constructor with suitable default values
  16. • Has appropriate data encapsulation methods
  17. • toString method returns a string representation of a Film object
  18. • Customer class
  19. • Stores the customer’s name, age, and if they are currently a student
  20. • Has a constructor with inputs for name, age and student
  21. • Has a default constructor with suitable default values
  22. • Has appropriate data encapsulation methods
  23. • toString method returns a string representation of a Customer object
  24. • RATING enumerated type
  25. • Has elements corresponding to New Zealand’s film rating systems:
  26. o General, films appropriate for all ages o Parental Guidance, ages 12 and above o Mature, ages 16 and above
  27. • Has an instance variable storing the minimal age for the film rating
  28. • Has a constructor with input for minimal age
  29. • Ticket class
  30. • Stores a Customer object and Film object
  31. • Has a method double cost() which calculates ticket cost as follows:
  32. o Standard ticket for adults: (aged 18 years or more) $10
  33. o Standard tickets for children: (aged less than 18 years) $7
  34. o Students between the ages of 10\25 have a 15% discount of their ticket
  35. o Students above 25 have a 10% discount off their ticket
  36. o Seniors (above the age of 64) and are not students have a 7% discount from the cost of their ticket
  37. • Has a constructor with inputs for Customer and Film
  38. • Is immutable but has appropriate get methods
  39. • 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
  40. • CinemaTicketBookingApplication class
  41. • 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
  42. • static main method initialises a primitive array of films (these may be hard\coded) and repeatedly issues tickets in the following manner:
  43. o invokes the method private static Customer customerDetailsInput() which prompts the user to enter their customer information, constructs and returns a Customer object
  44. 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
  45. 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.
  46. o The Ticket is issued (e.g. displayed to the console) and the customer is asked if they wish to purchase another ticket
  47. Sample Usage of CinemaTicketBookingApplication:
  48. Welcome to the Cinema Ticket Purchasing System Please enter your name:
  49. Jack Smith
  50. Please enter your age: 20
  51. Are you a student? (Y/N) Y
  52. Which film would you like to watch:
  53. 1 Ant-Man rating: (P)
  54. 2 Minions rating: (P)
  55. 3 Jurassic World rating: (M)
  56. 4 Inside Out rating: (G) 1
  57. Your ticket is ready to be collected!
  58. ————————————————————
  59. FILM TICKET for: Ant-Man rating: (P)
  60. CUSTOMER DETAILS: Jack Smith age: 20 Student? Yes TOTAL COST: $8.50
  61. ————————————————————
  62. Issue another ticket? (Y/N) Y
  63. Please enter your name: Holly Day
  64. Please enter your age: 10
  65. Are you a student? (Y/N) Y
  66. Which film would you like to watch:
  67. 1 Ant-Man rating: (P)
  68. 2 Minions rating: (P)
  69. 3 Jurassic World rating: (M)
  70. 4 Inside Out rating: (G) 3
  71. Sorry, cannot issue ticket for age restricted film Issue another ticket? (Y/N)
  72. N
  73.  
  74. Download|: http://solutionzip.com/downloads/cinema-ticket-booking-application-java/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement