Minutes are sections of an hour, each one is 1/60th, or 0.01666666666 of an hour, which doesn't make for easy, or accurate math. However, an hour converts into 60 minutes, which looks like a nice and easy round integer to me.
The formula that a-j gave you should let you calculate the entire time that they are in the parking garage. One point of style I would like to impress on you is this. "Programming languages have no order of operation" (in reality they do, but, instead of relying on it, use extra ()'s to SHOW what you mean, it works out in your favor at 11:30 at night when you are finishing of your second margirita). So instead of what a-j wrote, I would use the exact same thing, but I would put in some extra verboseness to make it look like this:
mins = (60*(hrOut - hrIn)) + (minOut - minIn);
|