The program below reads in the number of minutes entered by a user. The program that converts the number of minutes to hours and minutes. Run the program, then modify the code to work in reverse: The user enters two numbers for hours and minutes and the program outputs total minutes.

Respuesta :

Answer:

Written in Python:

hours = int(input("Hours: "))

mins = int(input("Minutes: "))

result = hours * 60 + mins

print("Result: "+str(result)+" minutes")

Explanation:

This line prompts user for hours

hours = int(input("Hours: "))

This line prompts user for minutes

mins = int(input("Minutes: "))

This line calculates the required output

result = hours * 60 + mins

This line prints the required output in minutes

print("Result: "+str(result)+" minutes")