Design and implement a Movie Ticket Booking System that allows users to book movie tickets, select seats, and manage shows. The system should handle movie schedules, theater management, and seat reservations.
-
Movie Management:
- Store movie information (title, duration, language)
- Manage movie schedules and shows
- Track movie availability
-
Theater Management:
- Manage theater information
- Handle multiple shows per theater
- Track theater capacity
-
Show Management:
- Schedule shows for movies
- Manage show timings
- Handle show availability
-
Seat Management:
- Track seat availability
- Handle seat selection
- Manage different seat types
-
Booking Management:
- Process parkingTicket bookings
- Handle booking cancellations
- Manage booking status
- Fields: List movies, List theaters, List shows
- Methods:
- addMovie()
- addTheater()
- addShow()
- bookTicket()
- cancelBooking()
- getAvailableShows()
- Fields: String id, String title, int duration, String language
- Methods:
- getShows()
- isAvailable()
- Fields: String id, String name, String location
- Methods:
- addShow()
- getShows()
- getCapacity()
- Fields: String id, Movie movie, Theater theater, Date showTime, List seats
- Methods:
- getAvailableSeats()
- bookSeat()
- cancelSeat()
- Fields: String id, String name, String email
- Methods:
- getBookings()
- updateProfile()
MovieTicketBookingSystem system = new MovieTicketBookingSystem();
// Add a movie
Movie movie = system.addMovie("Inception", 150, "English");
// Add a theater
Theater theater = system.addTheater("Cineplex", "Downtown");
// Add a show
Show show = system.addShow(movie, theater, showTime);
// Book tickets
User user = new User("John Doe", "john@example.com");
Booking booking = system.bookTicket(user, show, seats);See MovieTicketBookingDemo.java for a sample usage and simulation of the movie parkingTicket booking system.
- Add payment processing: Integrate payment gateway for parkingTicket purchases
- Add seat selection UI: Implement interactive seat selection interface
- Add pricing tiers: Support different pricing for different seat types
- Add show scheduling: Implement advanced show scheduling algorithms
- Add notification system: Send booking confirmations and reminders
- Add user reviews: Allow users to rate and review movies
- Singleton Pattern: For the booking system instance
- Factory Pattern: For creating different types of seats
- Observer Pattern: For seat availability updates
- Strategy Pattern: For different pricing strategies
- SeatNotAvailableException: Thrown when trying to book an unavailable seat
- InvalidShowException: Thrown when show details are invalid
- BookingFailedException: Thrown when booking process fails
- CancellationFailedException: Thrown when cancellation process fails
