Respuesta :

Python program that uses a function to calculate the miles traveled based on time and speed. Output image of the algorithm and code is attached.

Python code

  • #Function

def mph_and_minutes_to_miles(miles_traveled, miles_per_hour, minutes_traveled):

hours_traveled = minutes_traveled/60

miles_traveled = hours_traveled*miles_per_hour

return miles_traveled

  • #Main body

if __name__ == '__main__':

  •    #Define variables

miles_traveled = float()

miles_per_hour = float()

minutes_traveled = float()

hours_traveled = float()

  • #Entry data

print("Miles per hour: ", end="")

miles_per_hour = float(input())

print("Minutes traveled: ", end="")

minutes_traveled = float(input())

  • #Function calling

miles_traveled = mph_and_minutes_to_miles(miles_traveled,miles_per_hour,minutes_traveled)

#Output

print("Miles: ",miles_traveled)

To learn more about Python Functions see: https://brainly.in/question/16087371

#SPJ4

Ver imagen megatokay