• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To print date and times-tamp along with the data

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .

 
Marshal
Posts: 8857
637
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic