Pass one procedure's result into another

A delivery tracker provides two procedures with no side effects:

  • total_minutes(hours, minutes) accepts whole-number hours from 0 through 23 and minutes from 0 through 59. It returns 60 * hours + minutes, measured in minutes after midnight.
  • delay_minutes(planned, actual) accepts two times measured in minutes after midnight. It returns actual - planned, so a positive result means late arrival.

A delivery was planned for 09:35 and arrived at 10:08 on the same day. The tracker runs:


Python
planned = total_minutes(9, 35)
actual = total_minutes(10, 8)
delay = delay_minutes(planned, actual)


Find planned in minutes after midnight and delay in minutes. Give both as exact integers, to zero decimal places.

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Procedural and Data Abstraction Questions: