In: Computer Science
Need Java code for a small business for booking on various circus shows / online shows because of covid
Just need template I will add prices in my self
// Skeleton code in Java to design an online Circus
booking system.
Enums :
public enum SeatStatus {
SEAT_BOOKED,
SEAT_NOT_BOOKED;
}
public enum CircusStatus {
Circus_Available,
Circus_NotAvailable;
}
public enum CircusType {
ENGLISH,
HINDI;
}
public enum SeatType {
NORMAL,
EXECUTIVE,
PREMIUM,
VIP;
}
public enum PayStatus {
PAID,
UNPAID;
}
class User {
int userId;
String name;
Date dateOfBirth;
String mobNo;
String emailId;
String sex;
}
class Circus {
int CircusId;
int tentId;
CircusType CircusType;
CircusStatus CircusStatus;
}
class tent {
int tentId;
String tentName;
Address address;
List<Circus> Circuss;
float rating;
}
class Booking {
int bookingId;
int userId;
int CircusId;
List<Circus> bookedSeats;
int amount;
PayStatus status_of_pay;
Date booked_date;
Time Circus_timing;
}
class Address {
String city;
String pinCode;
String state;
String streetNo;
String landmark;
}
Extra: Handing
the cases where two persons are trying to access the same seat
almost same time
Class SeatBook
{
Transaction transaction_obj;
bool seats[total_seats];
String place;
String ticketType;
bool check_availability();
int position_of_seat()
{
return seat_pos_in_theator;
}
void multiple tickets();
void final_booking()
{
place = positon_of_seat();
if (single_ticket)
continue;
else
mutliple_ticket_booking();
Transaction_obj.pay(ticketType,
seats_booked, place);
}
}
Please Upvote if you like my answer and efforts. Thank you