Salam Air wants to get a better insight about its business in summer season 2023…
- User
Salam Air wants to get a better insight about its business in summer season 2023 regarding the flights that depart from Muscat by providing different statistics related to the flights and passengers. Create a java project that reads data from two input files. First file “trips” contains information about available trips like trip ID, destination, date, ticket price. While the second file “passengers” contains information about the passengers like passport number, name, age, trips ID (see sample input files below Figures 1&2). To promote its business, Salam Air decided to use special discount when calculating final ticket price depending on passengers age according to the following table. age discount <18 10% 18<=age<=50 15%
50 7% Your java project should produce the following report on an output file “report” (see sample output file, Figure 3) about passengers showing for each passenger the list of trips and its detailed information including ticket price after discount for each trip. Your project should include at least two classes beside the Main class. You must provide API documentation for each class. Trip class: Maintain trip information like: trip ID, destination, date, ticket price.
Passenger Class: Maintain the information of a passenger like passport number, name, age, discount, array of trips reserved by the passenger. This class may also do the following: 2 assigns suitable discount to the passenger according to age maintains an array called “reservations” that includes all trips information of the passenger with price of ticket modified to include discount. It includes the following methods:
- A constructor that initializes passenger information.
- Accessor methods to access the instance variables.
- Mutator methods that change the instance variables to given values.
- Method “discountAmount” to find suitable discount for the passenger.
- Method “passengerListTrips” to build array of string that holds information about all trips of the passenger with modified prices. Main class: Includes the following methods: main: which controls the project and read files data into two array lists “tripList” and “passList”. passengers_report: which prints the output report about passengers
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.