Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

A program is needed which will propose the route to take flights to get from some origin place to some destination place, when not all cities have

A program is needed which will propose the route to take flights to get from some origin place tosome destination place, when not all cities have direct connections to all other cities – and sovarious flights will need to be taken.Using the two provided files, you need to write a recursive method named determineRoute, whichwill be provided with the following parameters:• From – indicates which city to fly from• To – indicates which city you wish to get to• flightRoute – an arrayList which contains, in order, the current proposed route from theoriginal starting place, towards the final arrival place. Initially, when the first call to themethod is made, this list is empty, because you haven’t checked any flight routes yet.The purpose of the method, is to determine a viable route to get to the destination, by use of trialand error / backtracking recursion.You may like to draw for yourself a picture of the connections, so you can “see” how the cities arelinked.Because of the way the routes have been designed, it is possible that your program could makechoices that takes it on a journey that would be a vain circle. Therefore, if the current proposedroute reaches more than 7 flights and still is not reaching the destination, you should deem thatroute to be a wrong/worthless choice (and therefore, give up on it).You will need to consider:• What are the base / stopping cases• Which cases are successful, hopeful and failures.You can only use iteration to iterate through each possible outbound route for a chosen city, but youmust use recursive calls to test routes from each chosen city.The program should be able to determine routes between the following cities:• Johannesburg to Melbourne• Melbourne to Johannesburg• Johannesburg to Paris• Melbourne to Beijing• Really, any two cities, unless they are too far away.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question