0
Can somebody help me by this Code?
The following is the code: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scannner.nextInt(); //your code goes here int seconds = 0; days*60*60*12= seconds; system.out.printIn(seconds); } } I don‘t know what‘s wrong. The task is to convert days in seconds. In the Assignment they say that the number of days is 12, but in the code there is only this scanner. Can. somebody help me please?
2 Réponses
+ 2
int days = scanner.nextInt();
//there is an extra n in scanner
seconds = days*60*60*24;
//there are 24 hours in a day.
System.out.println(seconds);
//S should be uppercase in system
//it's small L not capital i in println
+ 1
Actually you assigning values in wrong way you have to calculate expression and store in seconds not like this which u have done
days*60*60*12=Seconds;