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:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

my script:

 

 

Write a program that calculates the estima#welcome banner
print("Welcome to the Trip Time Calculator") #banner
print()
#ask user for speed/mph and distance in miles
miles = float(input("Enter the miles travled:\t "))
mph = float(input("Enter the miles per hour:\t "))
miles = float(miles)
mph = float(mph)
print()
#print results
#speed=distance/time
#time=distance/speed
#distance=speed*time
print("Estimated traveled time")
hours = (round((miles // mph), ))#t=d/s
minutes = float(round((miles % mph), )) #returns wrong output
print("Hours:\t ", hours,
"\nMinutes: ", minutes)
ted 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
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY