Write a program that calculates the estimated hours and minutes for a trip given the number of miles traveled and the speed in miles per hour. Specifically, write a program that Welcomes the user to the Travel Time Calculator. Asks user for number of miles traveled(allow user to enter fractional values) Asks user for the speed in miles per hour (allow user to enter fractional values) Calculates the number of hours and minutes for the trip to the nearest integer value. Hint: You can use the built-in function round that rounds a given number to the rounded integer value. e.g. round(4) will return 4, round(4.125) will return 4, round(4.5) will return 4 and round (4.75) will return 5. Prints the number of hours and minutes for the trip. Here are some sample runs:

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter2: Elements Of High-quality Programs
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

Write a program that calculates the estimated hours and minutes for a trip given the number of miles traveled and the speed in miles per hour.

Specifically, write a program that

  • Welcomes the user to the Travel Time Calculator.
  • Asks user for number of miles traveled(allow user to enter fractional values)
  • Asks user for the speed in miles per hour (allow user to enter fractional values)
  • Calculates the number of hours and minutes for the trip to the nearest integer value. Hint: You can use the built-in function round that rounds a given number to the rounded integer value. e.g. round(4) will return 4, round(4.125) will return 4, round(4.5) will return 4 and round (4.75) will return 5.
  • Prints the number of hours and minutes for the trip.

Here are some sample runs:

à Python 3.8.1 Shell
Eile Edit Shell Debug Options Window Help
Welcome to the Trip Time Calculator
Enter the miles traveled: 200
Enter the miles per hour: 65
Estimated travel time
Hours: 3
Minutes: 5
>>> |
Ln: 13 Col: 4
Python 3.8.1 Shell
Eile Edit Shell Debug Options Window Help
Welcome to the Trip Time Calculator
Enter the miles traveled: 310.5
Enter the miles per hour: 80.5
Estimated travel time
Hours: 3
Minutes: 51
>>>
Ln: 23 Col: 4
Transcribed Image Text:à Python 3.8.1 Shell Eile Edit Shell Debug Options Window Help Welcome to the Trip Time Calculator Enter the miles traveled: 200 Enter the miles per hour: 65 Estimated travel time Hours: 3 Minutes: 5 >>> | Ln: 13 Col: 4 Python 3.8.1 Shell Eile Edit Shell Debug Options Window Help Welcome to the Trip Time Calculator Enter the miles traveled: 310.5 Enter the miles per hour: 80.5 Estimated travel time Hours: 3 Minutes: 51 >>> Ln: 23 Col: 4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Constants and Variables
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage