Condition changes every 2hrs n 1min. List it.

Okay guys...
Im really frustrated right now.. I've been working on this for 2 days..
couldn't figure it out.

Here is a question

The condition of a city changes every 2hrs and a min.
The condition of the city have changed on 2/07/2011 at 1:01.

And what you want to do is to show a list of time when the condition changes.
so if you put 2/09/2011 it will be 1:25, 3:26, 5:27......23:36.
it has to be till year 2016. so you have to make feb. 29days in 2012, and 2016.

i know it is real hard(mayb not for some of you guys then help me!!!)
can any of you guys help me plz?
just a idea or tip is okay.:)
it'll be much easier if you think of everything in the smallest unit: minutes

and then only reformat to mm/dd/yyyy at hours:minutes right before you output it

you can do this by using the modulus operator % to find the remainder of total minutes passed
and then dividing those minutes into smaller and smaller units, starting with the largest one first.

of course that all sounds good in theory, but i'm a c++ newbie too :)
ok to make it more close to the real word you can do the program like this:
use 5 for loops (years, months , days , hour and minutes)
and put your conditions in the correct place like the 29 february ,31 and 30 days in a month , no more than 24 hour per day , and so on )
i think it will be so easy if you think like this.
good luck.
Last edited on
Topic archived. No new replies allowed.