WilliamB.md 1.1KB

William Browns Explanation on the AirLine Example

First the program sees if you have the partner airlines in a text file and if it doesn't it will end the program using a try catch and a System.exit(0). If you do have an airlines.txt it starts to makes an array list of each airline to see who is in the partner group. They do that by scanning each line and splitting the string whenever there's a comma and putting it into an array-list. This all takes place inside a while loop because you don't know how many airlines are in the file. Once it is done creating an array-list of all the partners it prints the array out and prompts the user which airline is the miles enter from. Then it prompts them what is their goal airline. Depending on the answers from the prompt it will go thorough some if else statements and decide if it is true and you can redeem your miles or if there is something wrong and return false then end the program. The purpose of the program is to convert miles from one airline to another. The program has to process if there is enough mile to convert. It also has to consider if there is even an airline that takes the current airline's miles.