5.3k views
4 votes
Complete the function definition to output the hours given minutes. Output for sample program:

a) hours = minutes / 60
b) hours = minutes * 60
c) hours = 60 / minutes
d) hours = 1 / minutes

1 Answer

3 votes

Final answer:

To convert minutes to hours, divide the number of minutes by 60. For example, 180 minutes is equal to 3 hours. You convert hours to minutes by multiplying the hours by 60, and 4 hours is 240 minutes.

Step-by-step explanation:

To convert minutes to hours, you need to divide the number of minutes by 60 since there are 60 minutes in one hour.

For instance:

  • 180 minutes divided by 60 equals 3 hours.
  • Similarly, for 100 minutes, you would divide by 60 to get 1 hour and then take the remainder, 40 minutes, to report the time as 1 hour 40 minutes.

When dealing with seconds,

  • 120 seconds divided by 60 equals 2 minutes.

And to convert hours to minutes,

  • Multiply the number of hours by 60. For example, 4 hours times 60 equals 240 minutes.

For subtracting time,

  • To find the difference between 2 minutes 30 seconds and 1 minute 50 seconds, you'd need to borrow from the minutes when the seconds in the second time are greater than the seconds in the first time and then subtract to find the difference.

To deal with fractional units of time,

  • A quarter of an hour, or 1/4 of an hour, equals 15 minutes since (1/4) times 60 minutes equals 15.

User Martin Schaer
by
7.2k points