Question: 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 Java-based application that simulates the booking of bus trips. The application should manage bookings for two types ut buses (AC and NON_AC) 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. + From To Fare Coimbatore Chennai 1200/- Coimbatore Bangalore 2210/- Hyderabad Chennai 3140/- Delhi Faridabad 1450/- 1. Bus: Attributes: starting place, destination place, seating capacity, bus number Add constructors and additional member functions if necessary. 2. NON_AC_BUS is a type of Bus A method called calculatefare () for calculate and return the total fare as "no of passengers * fare The fare value is given in the table above. Add constructors and additional member functions if necessary. 3. AC_BUS is a type of Bus A final variable for storing the AC_tax % as 2.5% 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. 5. Passenger is a person Attributes: Fromplace, Toplace, Bus type (AC/NON_AC), Number of companions, Booking Status (BOOKED/FAILED), Total fare Methods: 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 necessary Create a test class in Java and perform the following Read 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 1: 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 class) Option 2: Display Status of All AC and NON AC Buses details: Display Format: Bus Number, Current Number of Seats Available Option 3: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!