Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+4 votes
asked in old_CSC201 by (1 point)

1 Answer

+1 vote

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 (1 point)
...