Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

richard4339

macrumors 6502a
Original poster
Sep 6, 2006
896
112
Illinois
I'm writing a C++ program to calculate wait times for an amusement park ride (assignment for class, we're preparing for a programming competition). I've looked through my references and online, and can't seem to find a good library to do this, so I wanted to know if anyone knew one I had missed.

I have an integer value in military time. I need to add an integer to it which is time in minutes, and it give me the resulting time in military time again.

IE: integer military time (0910) + 110 minutes = 1100
1304 + 450 minutes = 2034

Any ideas anyone?
 

richard4339

macrumors 6502a
Original poster
Sep 6, 2006
896
112
Illinois
That's what I figured I'd do if all else fails.

910 + 450 would be...

450 / 60 = number of hours
450 % 60 = number of minutes

that just leaves me with exceptions if it gets higher than 60 minutes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.