Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

To print date and times-tamp along with the data  RSS feed

 
pooja rathi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Here i am trying to print from start date to end date along with the data value for a, b and c and this value should be cumulative it should be change as per the time .
but right now i am not getting appended values for a,b and and not getting date ,time-stamp and data together .

 
Liutauras Vilda
Marshal
Posts: 4633
316
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
pooja rathi
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Knute Snortum
Sheriff
Posts: 4073
112
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

This is line 91: Date and Time don't seem to have been declared.

The code has a number of compile errors in it. It will be helpful if you post the actual code you are using.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!