In: Computer Science
Description: The purpose of the program is to create a Java ticket purchasing program that allows for users to log in, purchase tickets, keep records of tickets purchased, and keep information about the user.
Program Requirements: The following are the program requirements:
Deliverables: All program code and documentation including a user guide.
Java ticket purchasing program that allows for users to log in, purchase tickets, keep records of tickets purchased, and keep information about the user
How to implement seat booking process?
Solution :
The Main Classes to be used for the user personas :
Here we create movie ticket booking system like Bookmyshow....you just have to change name class movie to get your program.
//CODE
// Java skeleton code to design an online Ticket booking
system.
// booking system.
Enums :
public enum SeatStatus {
SEAT_BOOKED,
SEAT_NOT_BOOKED;
}
public enum MovieStatus {
Movie_Available,
Movie_NotAvailable;
}
public enum MovieType {
ENGLISH,
HINDI;
}
public enum SeatType {
NORMAL,
EXECUTIVE,
PREMIUM,
VIP;
}
public enum PaymentStatus {
PAID,
UNPAID;
}
class User {
int userId;
String name;
Date dateOfBirth;
String mobNo;
String emailId;
String sex;
}
class Movie {
int movieId;
int theaterId;
MovieType movieType;
MovieStatus movieStatus;
}
class Theater {
int theaterId;
String theaterName;
Adress adress;
List<Movie> movies;
float rating;
}
class Booking {
int bookingId;
int userId;
int movieId;
List<Movie> bookedSeats;
int amount;
PaymentStatus status_of_payment;
Date booked_date;
Time movie_timing;
}
class Address {
String city;
String pinCode;
String state;
String streetNo;
String landmark;
}
/*This is an OOP design question, so full code is not required. The
above code has classes and attributes only. In the above code, as
you can see enums are self-explanatory.
We have users class in which users details are kept.
Theater class in which name of the theater, it’s address and list
of movies currently running are kept.
Booking class lets you book the seat in a particular theater. It
keeps a reference in Movie, Payment class.*/
This is your answer just run the code in compiler.