Liutauras Vilda wrote:Welcome to the Ranch.
I don't know where the problem is right away, but I know how you could find it yourself.
1. Start by decomposing your problem into smaller pieces so you could handle complexity.
2. You got lots of code repetition, i.e. lines: [70-73], [75-79], [81-84].
3. Indentation inconsistent in terms of braces placing style as well as formatting issues.
4. Lots of magic numbers, as 1, 720. Please explain those lines [64-66]:
5. What variable names a, b, c, a2, b2, c2 represent?
6. Why variable RECORD_COUNT named in that way if it is not a constant?
7. What this number represent 86400000?
I wouldn't be happy with my code like that and I would look for the ways to make it more readable even at the beginning. Most likely decomposing problem into smaller problems would unhide your error.
Actually here i am trying to make data for 1 day initially so i have taken days as a variable and days=1 after that i want to print data every after 2 mins so for a day it will be 24hrs * 60=1440 /2 =720
so i want 720 records for a single day.
Expected output should be like this:
Date Time a b c
01/01/2016 12:00:00 220 0.12 0.1
01/01/2016 12:02:00 221 0.13 0.2
01/01/2016 12:04:00 222 0.14 0.3
till
01/01/2016 11:58:00 250 3.9 4.9
then again
02/01/2016 12:00:00 220 0.12 0.1