Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+1 vote
asked in CSC201 by (4.2k points)

1 Answer

0 votes

First, we are assuming alarm time is after actual time if we need to find the number of minutes until the alarm rings.

Let's assume the actual time is 625 and the alarm time is 805. The difference is 100 minutes, but that isn't 805 - 625. How can the 100 minutes be calculated?

Here's one stategy:
Convert each time to the number of minutes since midnight:
625 = 6 60 + 25 = 385 minutes
805 = 8
60 + 5 = 485 minutes
Then subtract:
485 - 385 = 100 minutes

To get the 6 and 25 "separated" from 625 think about // and %.

answered by (4.2k points)
...