ISGB 7990 Python Programming Assignment
WARNING: Code must be completed individually. Any indication that a student has completed someone else’s code or had someone else complete her/his code will result in a failing grade in the course and further punishment by the University’s Academic Integrity Board.
Although not required, students are encouraged to diagram the application.
Submit a py file named [FirstName][LastName]Exam2.py, like MichaelDeamerExam2.py. Do not submit diagrams or itinerary.txt (from step i).
Build a road trip planner to calculate the cost of individual legs of a trip and the trip as a whole. The code will:
and $3.00 per gallon gas price (cost equals distance divided by miles-per-gallon multiplied by the price of a gallon of gas). d. Append a string describing this this leg of the journey to a list, which will be printed after all
legs are entered. The string should be in this format:
[Starting Location] to [Destination] will cost [Amount] e. Ask if the user will travel beyond this destination. If the user wishes to enter more
destinations, repeat steps a through d using a loop. Note that the new starting location will be the destination from the previous iteration of the loop –i.e. the user will start the next leg where she/he ended the previous leg. (Hint: you could accomplish this with a line of code near the end of your loop: startingLocation = destination) f. Calculate the accumulated cost of the entire trip. g. After all stops are entered, print the cost of traveling from the first starting location to the
final destination in this format:
Your entire trip from [First Starting Location] to [Final Destination] will cost [Amount]
individual leg of the journey, which should look something like this:
Buenos Aires to Santiago will cost $77.57 Santiago to Santa Cruz will cost $132.86 Santa Cruz to Lima will cost $128.57
Lima to Bogota will cost $154.29
In all, the application should contain at least two distinct loops:
strings to a list, and accumulate the cost of the entire trip; and 2. A simple for loop to print information about each leg of the journey. ISGB 7990 Python Programming Assignment
Welcome to the road trip planner!
Please enter your starting location:
From Buenos Aires, where will you travel?
How far away is Santiago from Buenos Aires?
Will you be travelling beyond Santiago (Enter ‘n’ for no)?
From Santiago, where will you travel?
How far away is Santa Cruz from Santiago?
Will you be travelling beyond Santa Cruz (Enter ‘n’ for no)?
From Santa Cruz, where will you travel?
How far away is Lima from Santa Cruz?
Will you be travelling beyond Lima (Enter ‘n’ for no)?
From Lima, where will you travel?
How far away is Bogota from Lima?
Will you be travelling beyond Bogota (Enter ‘n’ for no)?
Your entire trip from Buenos Aires to Bogota will cost $493.29
Buenos Aires to Santiago will cost $77.57
Santiago to Santa Cruz will cost $132.86
Santa Cruz to Lima will cost $128.57
Lima to Bogota will cost $154.29. ISGB 7990 Python Programming Assignment