Question
1. Using arrays to store and process data (10 points) 2. Use at least one array of objects (10 points) 3. Use sorting to arrange
1. Using arrays to store and process data (10 points) 2. Use at least one array of objects (10 points) 3. Use sorting to arrange data (10 points) 4. Use methods to do separate and repetitive work. The main method should not have more than 20 lines of code (10 points) 5. Implement the project correctly (50 points) 10 points will be awarded for use of meaningful identifiers, consistent indentation, explanatory comments in your code and properly formatted output, including screen shots of execution. B. Description Suppose you are creating a software for online travel booking system. In this project, you have to simulate such a system for booking flights between 2 cities. 1. Create a data set of 20 flight options between 2 cities 2. For each of the flights assign a carrier name (you can use actual airline companies or Airline1, Airline2 etc.) 3. Assign a random duration for each of the flights (the range of the duration would be 45 minutes to 1 hour 15 minutes); make sure each flight duration is unique 4. Assign a random departure time for each of the flights (the range would be 6:00 AM to 10:00 PM) 5. Based on the departure time and flight duration, assign an arrival time for each of the flights 6. Assign a random price to the ticket (range $50 to $250)
Use a separate class to create the flight objects. All the flight objects must be stored using an array. You can use additional arrays as necessary. The sorting code must be included as part of the project. Create a menu based program with the following options: 1. List all the flights between 2 given cities 2. Display the flights sorted according to flight duration, starting with the shortest one 3. Display the flights according to departure time, starting with the earliest departure time 4. Display the flights according to arrival time, starting with the earliest arrival time 5. Display the flights according to ticket price, starting with lowest price 6. Search for a ticket using a specific airline, and display all the details if such a flight exists 7. Although not usually part of design, but provide an option for the user to add a flight to the list of flights (ask the user for all the details). This can be used to test the other parts of the program 8. Exit The program continues to execute until the user selects option to Exit. The user is allowed to add a maximum of 5 flights.
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