Answer:
Here is code in python .
#function to calculate miles traveled
# pass two parameter in the function "miles_per_hour" and "minutes_traveled"
def mph_and_minutes_to_miles(miles_per_hour, minutes_traveled):
# convert minutes to hours
hours_traveled = minutes_traveled / 60.0
#calculate total miles traveled
miles_traveled = hours_traveled * miles_per_hour
#return the value
return miles_traveled
#read input from user
miles_per_hour = float(input())
minutes_traveled = float(input())
#call the function and print the output
print('Miles: %f' % mph_and_minutes_to_miles(miles_per_hour, minutes_traveled))
Explanation:
Read the value of "miles_per_hour" and "minutes_traveled" from user. call the function mph_and_minutes_to_miles() with those two parameters.calculate total hours from the minutes_traveled by dividing it with 60. then calculate the total miles by multiply hours_traveled * miles_per_hour. then return the miles travelled.
Output:
20
150
Miles: 50.000000