Exercise · Operators and type conversion · lesson 13 of 14
Exercise: hours and minutes
Write two functions. function hoursOf(totalMinutes) returns how many whole hours there are in totalMinutes minutes, and function minutesOf(totalMinutes) returns how many minutes remain on top of those hours.
hoursOf(135)→2minutesOf(135)→15minutesOf(120)→0
Constraints: totalMinutes is a whole number from 0 to 100000; less than an hour is 0 whole hours.
Do not add extra imports unless the task says so explicitly.
Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.