Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Geek Watch

 
sumant suri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have been trying to work this assignemt out for the past few days, but i just cant get it to work. I think part of myproblem is that i dont know how to use the Date Class.
here is the code i have:

Please do not post your code. You can post snippets or pseudocode instead. -- Marilyn

[This message has been edited by Marilyn deQueiroz (edited June 02, 2001).]
 
Richard Boren
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the Date methods gives you the number of milliseconds since January 1, 1970. From there you do the old how many seconds make a minute, how many minutes make a hour, how many hours make a day type math to figure out the number of seconds and days. Also you don't need to use any of the deprecated Date methods.
Hope this helps.
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than trying to put the date into the Date constructor, you should use the parameters from the command line for your calculations. Instantiate Date. Then you can do your calculations (using methods from the Date class) using those parameters and the Date object you have instantiated.
 
Sayed Ibrahim Hashimi
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A quick question: Why did you say that we can't post code?
Did he/she post a lot?
Originally posted by Marilyn deQueiroz:
Rather than trying to put the date into the Date constructor, you should use the parameters from the command line for your calculations. Instantiate Date. Then you can do your calculations (using methods from the Date class) using those parameters and the Date object you have instantiated.

 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ibrahim Hashimi:
A quick question: Why did you say that we can't post code?
Did he/she post a lot?

Sumant Suri posted his/her entire solution. I removed most of the code and replaced it with "// stuff".

Usually I prefer that you don't post code here. If you post great code, you will be robbing others of an education.


[This message has been edited by Marilyn deQueiroz (edited June 02, 2001).]
 
sumant suri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry abt posting code. DId'nt know u'r policy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic