- 2
I need a Java code program to convert days to seconds.
The given code takes the amount of days as input. Complete the code to convert it to seconds and output the result. Sample Input: 12 Sample Output: 1036800 12days * 24hrs =288hrs which 288hrs *60 minutes =17280 Which 17280 *60seconds =1,036,800 seconds
3 Answers
+ 5
Nature ,
please do not ask the community for a ready-made code.
everything you need to know is already written by you in your post. you have also finished 92% of the java tutorial. so i am sure that you can do this task by yourself.
is it because you have started java 3 years ago, and can not remember all details? maybe you like to go through the tutorial and refresh your knowledge...
+ 2
Nature
1 day = 24 hours
1 hour = 60 minutes
1 minute = 60 seconds
So 1 day = 24 * 60 * 60
Now take this hint and solve problem
+ 1
Go and search the "Code" section, that's where the codes are. The Discussion forum is not place to ask for codes.