- 1
I'm having trouble with the time converter in java. Can anybody give me any assistance?
This is a bonus problem in Java. https://code.sololearn.com/c09hQI3pie50/?ref=app
7 Réponses
+ 2
Firstly, what does it has to do with the code you posted ?
& secondly you must show your attempt before asking for help.
+ 1
Kevin Merric C'mon you have literally pasted the whole problem instead of what you tried, Anywho
days * 24 * 60 * 60
Days * 24 = hours in each (N) Days
Days * 24 * 60 = min in each (N) Days
Days * 24 * 60 * 60 = sec in each (N) Days
+ 1
Kevin Merric Okay
0
Just ask yourself.
How many hours has a day.
How many minutes has a hour.
And so on.
And if you want to know the current time as timestamp take a look at this.
https://www.sololearn.com/learn/530/?ref=app
0
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
//your code goes here
}
}
/*Explanation: 12 days are 12*24 = 288 hours, which are 288*60 = 17280 minutes, which are 17280*60 = 1036800 seconds.*\
0
This is the problem. I've made many attempts before asking. Could somebody please help me solve this???
0
I swear I've been trying for two days and kept having to reset it... I'll give it a try now ty