import math # Lab 3 - Road Trip # Program determines the time it takes to complete a road trip from Chicago to other cities in the US # and how many podcasts you can listen to on the road trip # TODO: Add your name and the names of your team members # Get input from user of what city they would like to visit city = input("What city would you like to visit? ") distance_to_city = {   'Chicago': 0,   'Minneapolis': 410,   'Columbus': 350,    'Nashville': 475,   'Denver': 1005 } speed = 70 # miles per hour hours_per_day = 8 # hours you can travel per day podcast_length = 25 # minutes # TODO: finish the code here

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
import math

# Lab 3 - Road Trip
# Program determines the time it takes to complete a road trip from Chicago to other cities in the US
# and how many podcasts you can listen to on the road trip

# TODO: Add your name and the names of your team members


# Get input from user of what city they would like to visit
city = input("What city would you like to visit? ")

distance_to_city = {
  'Chicago': 0,
  'Minneapolis': 410,
  'Columbus': 350, 
  'Nashville': 475,
  'Denver': 1005
}

speed = 70 # miles per hour
hours_per_day = 8 # hours you can travel per day
podcast_length = 25 # minutes

# TODO: finish the code here
You are going to write a program which estimates some features of a road trip. You should do this together with your group. You have two
options:
Write out the code together on piece of paper or white board (good practice for exams). Once you have worked out the solution, transfer
into zyLabs and test.
Write out code together in one person's zyLab. Test together. Then transfer to the other teams zyLab once done.
STEP 1: Estimate how many days it takes to get from Chicago to the inputted city. Output result to the screen, for example:
What city would you like to visit? Denver
It will take 2 day(s) to road trip from Chicago to Denver
You can do this calculation by using the dictionary to look up the distance, dividing that distance by speed, and converting the result into
days (assuming you can drive 8 hours per day). Round the final number of days up using the ceiling function.
STEP 2: You are going to add another calculation. Assuming it takes 25 minutes to listen to a podcast, add the code that calculates how
many complete podcasts you can listen to during your road trip. If you find that you can listen to 8.5 podcasts, your answer should output
you can listen to 8 total podcasts. Output your result to the screen, for example:
What city would you like to visit? Denver
It will take 2 day(s) to road trip from Chicago to Denver
Number of podcasts you can listen to: 34
STEP 3: Edit the dictionary distance_to_city to include two new cities. These should include Portland which is 2125 miles from Chicago and
Tampa which 1170 miles from Chicago. Test your code to make sure it works for these two new cities.
Transcribed Image Text:You are going to write a program which estimates some features of a road trip. You should do this together with your group. You have two options: Write out the code together on piece of paper or white board (good practice for exams). Once you have worked out the solution, transfer into zyLabs and test. Write out code together in one person's zyLab. Test together. Then transfer to the other teams zyLab once done. STEP 1: Estimate how many days it takes to get from Chicago to the inputted city. Output result to the screen, for example: What city would you like to visit? Denver It will take 2 day(s) to road trip from Chicago to Denver You can do this calculation by using the dictionary to look up the distance, dividing that distance by speed, and converting the result into days (assuming you can drive 8 hours per day). Round the final number of days up using the ceiling function. STEP 2: You are going to add another calculation. Assuming it takes 25 minutes to listen to a podcast, add the code that calculates how many complete podcasts you can listen to during your road trip. If you find that you can listen to 8.5 podcasts, your answer should output you can listen to 8 total podcasts. Output your result to the screen, for example: What city would you like to visit? Denver It will take 2 day(s) to road trip from Chicago to Denver Number of podcasts you can listen to: 34 STEP 3: Edit the dictionary distance_to_city to include two new cities. These should include Portland which is 2125 miles from Chicago and Tampa which 1170 miles from Chicago. Test your code to make sure it works for these two new cities.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education