Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Determine miller indices of plane X z 2/3 90% a/3

Answered: 1 week ago