Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE MAKE USE OF JAVA TO WRITE THIS PROGRAM. Project 6 Plan a Flight Introduction: In this project, you will determine the shortest/cheapest flight plans
PLEASE MAKE USE OF JAVA TO WRITE THIS PROGRAM.
Project 6 Plan a Flight Introduction: In this project, you will determine the shortest/cheapest flight plans for a person wishing to travel between two different cities serviced by an airline (assuming a path exists), using Dijkstra's algorithm with priority queues. You will also calculate the total cost incurred for a parts of the trip. For this project, you will use information from two different input files in order to calculate the trip plan and total cost 1. origination and Destination Data This file will contain a sequence of city pairs representing different legs of flights that can be considered in preparing a flight plan. For each leg, the file will also contain a dollar cost for that leg and a time to travel For each pair in the file, you can assume that it is possible to fly only in one directions 2. Requested Flights This file will contain a sequence of origin/destination city pairs. For each pair, your program will determine if the flight is or is not possible. If it is possible, it will output to a file the cheapest/shortest flight plan with the total cost for the flight. If it is not possible, then a suitable message will be written to the output file The names of the two input files as well as the output file will be provided via command line arguments Flight Data: Consider a flight from Detroit to El Paso. It's possible that there is a direct flight, or it may be the case that a stop must be made in Austin. One stop in Austin would mean the flight would have two legs. We can think of the complete set of flights between different cities serviced by our airline as a directed graph. An example of a directed graph is given in Figure 1. In this example, an arrow from one city to another indicates the direction of travel. The opposite direction is not possible unless a similar arrow is present in the graph. For this programming In the spirit of simplicity, we will not consider layovers in this project. Project 6 Plan a Flight Introduction: In this project, you will determine the shortest/cheapest flight plans for a person wishing to travel between two different cities serviced by an airline (assuming a path exists), using Dijkstra's algorithm with priority queues. You will also calculate the total cost incurred for a parts of the trip. For this project, you will use information from two different input files in order to calculate the trip plan and total cost 1. origination and Destination Data This file will contain a sequence of city pairs representing different legs of flights that can be considered in preparing a flight plan. For each leg, the file will also contain a dollar cost for that leg and a time to travel For each pair in the file, you can assume that it is possible to fly only in one directions 2. Requested Flights This file will contain a sequence of origin/destination city pairs. For each pair, your program will determine if the flight is or is not possible. If it is possible, it will output to a file the cheapest/shortest flight plan with the total cost for the flight. If it is not possible, then a suitable message will be written to the output file The names of the two input files as well as the output file will be provided via command line arguments Flight Data: Consider a flight from Detroit to El Paso. It's possible that there is a direct flight, or it may be the case that a stop must be made in Austin. One stop in Austin would mean the flight would have two legs. We can think of the complete set of flights between different cities serviced by our airline as a directed graph. An example of a directed graph is given in Figure 1. In this example, an arrow from one city to another indicates the direction of travel. The opposite direction is not possible unless a similar arrow is present in the graph. For this programming In the spirit of simplicity, we will not consider layovers in this projectStep 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