Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your task is to build a booking App, a Java - based application that simulates the booking of bus trips. The application should manage bookings
Your task is to build a booking App, a Javabased application that simulates the booking of bus trips. The application should manage bookings for two typesut buses AC and NONAC and process passenger bookings based on bus availability and fare calculations.The APP has the following BUS routes, the service and fare details are listed low.FromToFareCoimbatoreChennaiCoimbatoreBangalore HyderabadChennaiDelhiFaridabad Bus:Attributes: starting place, destination place, seating capacity, busnumberAdd constructors and additional member functions if necessary. NONACBUS is a type of BusA method called calculatefare for calculate and return the total fare as no of passengers fareThe fare value is given in the table above.Add constructors and additional member functions if necessary. ACBUS is a type of BusA final variable for storing the ACtax as A method called calculatefare for calculate and return the total fare as no of passengers fare tax of AC no of passengers fare The fare value is given in the table above.Add constructors and additional member functions if necessary.Person:Attributes: Name, Person id Add constructors and additional member functions if necessary. Passenger is a personAttributes: Fromplace, Toplace, Bus type ACNONAC Number of companions, Booking Status BOOKEDFAILED Total fareMethods: toString To display booking details in the below format.Passenger Name, Passenger ID Booking Status, From place To Place, Number of companions, Total fare and BUS number.Add constructors and additional member functions if necessaryCreate a test class in Java and perform the followingRead details of n AC buses.Read details of m NON AC buses.:Read details for k passengers including from place, to place, bus type, and number of companions.Check the availability of the desired bus type and seats.If available, confirm the booking, calculate the total fare, and set the booking status to "BOOKED"If not available, set the booking status to FAILED and fare to zero.After the booking attempt by k passengers, display the following based on the option.Option : Display Booking details of All Passengers:Display Format: Passenger Name, Passenger ID Booking Status, From place To Place, Number of companions, Total fare and BUS number.use the toString method defined in the passenger classOption : Display Status of All AC and NON AC Buses details:Display Format: Bus Number, Current Number of Seats AvailableOption : Display Bookings details from Coimbatore to Chennai:Display Format: Name of the passenger, Total fare paid
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started