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.0miles_traveled = hours_traveled * miles_per_hourprint('Miles: %f' % miles_traveled)Sample output with inputs: 70.0 100.0Miles: 116.666667

Respuesta :

ijeggs

Answer:

def mph_and_minutes_to_miles(hours_traveled,miles_traveled ):

   hours_traveled = minutes_traveled / 60

   miles_traveled = hours_traveled * miles_per_hour

   print('Miles: %f' % miles_traveled)

Explanation:

Using Python programming language. The function is given above specifying two positional arguments (hours_traveled,miles_traveled)

In the main function, the user is prompted for inputs, the method is called and the user's input is passed as parameters. See complete code and output attached

Ver imagen ijeggs