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

QUESTION

In this Python programming assignment you will review a non-functional program and its intended output. Your

InfoTc 1040 Introduction to Problem Solving and Programming Debugging Trip Planner Trip Planner is a program designed to help you manage the details of your next trip. It provides you with a list of potential travel destinations, asks how long you’ll be staying, and saves that information as an itinerary. Trip Planner and its modules are attached to this assignment in TripPlanner.zip Unfortunately, Trip Planner is currently non-­‐functional. It contains several syntax and logic errors that prevent it from working properly. Your mission is to find and fix those errors. Review the program requirements and desired output described below. Use that information and your troubleshooting skills to debug Trip Planner. Trip Planner Components Trip Planner consists of planner.py and two custom modules: destinations.py and currency.py planner.py planner.py is the starting point for this application. It asks the user about their trip, calculates the cost of the trip, and saves that information to a text file named itinerary.txt destinations.py This module provides information about three travel destinations: Rome, Berlin, and Vienna. It defines a function called get_choice() to help the user decide on a destination. currency.py This module provides two functions: one that converts dollar amounts to euros and another that converts euro amounts to dollars. Exception Handling • The application should not crash based on the user’s input. • planner.py should only accept positive (not negative or zero) lengths of stay. • The get_choice() function in destinations.py should only accept 1, 2, or 3. 1 InfoTc 1040 Introduction to Problem Solving and Programming Debugging Trip Planner Expected Output Here is an example of the program functioning properly. The user’s input is highlighted in orange. -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ Welcome to the Trip Planner -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ Travel Options -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ 1. Rome 2. Berlin 3. Vienna Where would you like to go? 2 And how many days will you be staying in Berlin? 5 Your trip to Berlin has been booked! After running, this program would have generated a text file named itinerary.txt. That file is attached to this assignment as itinerarySample.txt and its contents are listed below. You can use it to check your output. Trip Itinerary -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ Destination: Berlin Length of stay: 5 Cost: $100.80 2 InfoTc 1040 Introduction to Problem Solving and Programming Debugging Trip Planner Make sure to check Trip Planner’s error handling as well. For example: -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ Welcome to the Trip Planner -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ Travel Options -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐ 1. Rome 2. Berlin 3. Vienna Where would you like to go? Vienna The value you entered is invalid. Only numerical values are valid. Where would you like to go? 4 Please select a choice between 1 and 3. Where would you like to go? 3 And how many days will you be staying in Vienna? -­‐1 Please enter a positive number of days. And how many days will you be staying in Vienna? 0 Please enter a positive number of days. And how many days will you be staying in Vienna? ten days The value you entered is invalid. Only numerical values are valid. And how many days will you be staying in Vienna? 10 Your trip to Vienna has been booked! Submission Place your debugged planner.py, destinations.py, and currency.py files in a folder named <lastname><firstname>TripPlanner and zip the folder. Do not include characters other than a-­‐z and A-­‐Z in the folder name. Submit this zip file on Blackboard. 3

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