Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java programming help please! Please let me know how I should try the code out in Eclipse such as paste everything as is into one
Java programming help please! Please let me know how I should try the code out in Eclipse such as paste everything as is into one section or what I should do (try putting into the same folder as the project and so on). Thank you in advance!
airport.txt:
ATL BOS 250 DFW 250 MOB 59 AUS DFW 59 HOU 59 SAT 59 BOS ATL 250 DFW 250 DFW ATL 250 AUS 59 BOS 250 HOU 128 LAX 1000 LIT 59 MSY 128 OKC 59 SHV 59 SFO 1200 HOU AUS 59 DFW 128 SAT 59 LAX DFW 1000 SFO 100 LIT DFW 59 MOB ATL 59 MSY DFW 128 OKC DFW 59 SAT AUS 59 HOU 59 SFO DFW 1200 LAX 100 SHV DFW 59Overview: In this project you will use Dijkstra's algorithm to find route information between two airports chosen by the user. The user w1?? be shown a route that results in the lowest price. Details: Write a Java program that lets the user choose two airports and finds the route that has the least price. Your program should read the airports.txt file that is posted, or any file having the same format. It should then prompt the user to enter two airports. Dijkstra's algorithm should be run to find the cheapest route. The price, number of connections, and actual route should be shown. The user should be able to continue checking routes until no more routes are requested. You are expected to write Dijkstra's algorithm yourself following the pseudocode found in both the slides and in the textbook. You can use the Vertex class and printPath found in the textbook if you wish. You may not use code for Dijkstra's algorithm found from other sources Your output should match the sample output below: Sample output: Enter departure airport DFW Enter arrival airport: SFO By price: Price: Connections: 1 Route: 1100 DFW> LAX -SFO Check another route (Y/N)? Submit to eLearning: Put your source file (s) into a .zip file called project5.zip and submit only the .zip file
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