Calculate the total cost incurred for all parts

Assignment Help JAVA Programming
Reference no: EM131478339

Project - 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 all 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 travel1. 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 challenge, each arrow or flight path would also have a cost associated with it. If we wanted to travel from El Paso to city Chicago, we would have to pass through Austin and Detroit. This would be a trip with three legs (El Paso to Austin, Austin to Detroit and Detroit to Chicago). It is possible that there might not be a path from one city to another city. In this case, you'd print an error message indicating such.

734_Figure.jpg

Figure 1 - Sample Directed Graph

The input file for flight data will represent a sequence of origin/destination city pairs with a cost of that flight. The first line of the input file will contain an integer which indicates the total number of origin/destination pairs contained in the file.

Reference no: EM131478339

Questions Cloud

Case study - making norwich tools lathe investment decision : Case Study 2: "Making Norwich Tool's lathe investment decision. Use the payback period to assess the acceptability and relative ranking of each lathe
Identify the tasks that gain importance for investment : Identify the tasks that gain importance for investment advisors and portfolio managers if apparent excess returns turn out to have their origin in previously.
How can the internet be used for counter-terrorism : Use of the Internet for Terrorist Purposes. What are the major ways in which terrorists use the Internet? How can the Internet be used for counter-terrorism?
Define completely hedges all market risks including beta : Discuss whether constructing a well-diversified portfolio is possible that completely hedges all market risks including beta, value, and size risks.
Calculate the total cost incurred for all parts : You will also calculate the total cost incurred for all 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.
Gender inequality in pay : Much is in the news related to gender inequality in pay. Identify the issue, discuss how the country, states, and cities are working towards
Five practices of exemplary leadership : In the Five Practices of Exemplary Leadership explain how Challenge the Process and Enable Others to Act practices improve communication
Transformational leadership theories : Explain how the Transformational Leadership Theories can improve in communication, trust, and listening skills."
Would you recommend flood prevention systems : How would you address the potential flood areas, especially the grammar school? Would you recommend flood prevention systems?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd