Ask Question
5 May, 12:56

Write a function so that the main program below can be replaced by the simpler code that calls function mph_and_minutes_to_miles (). Original main program: miles_per_hour = float (input ()) minutes_traveled = float (input ()) hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print ('Miles: {:f}'. format (miles_traveled)) Sample output with inputs: 70.0 100.0 Miles: 116.666667

+3
Answers (1)
  1. 5 May, 14:24
    0
    def mph_and_minutes_to_miles (miles_per_hour, minutes_traveled):

    hours_traveled = minutes_traveled / 60.0

    miles_traveled = hours_traveled * miles_per_hour

    return miles_traveled

    miles_per_hour = float (input ())

    minutes_traveled = float (input ())

    print ('Miles: %f' % mph_and_minutes_to_miles (miles_per_hour, minutes_traveled))
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a function so that the main program below can be replaced by the simpler code that calls function mph_and_minutes_to_miles (). ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers