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?

19th Jul 2021, 7:36 AM
Alexander Abt
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
19th Jul 2021, 8:07 AM
Simba
Simba - avatar
+ 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;
19th Jul 2021, 7:53 AM
A S Raghuvanshi
A S Raghuvanshi - avatar