0

Can’t get 2 separate outputs

I’m doing the time converter project and I can’t seem to get the two outputs to separate. Anyone know how I could do this? This is what I have so far: 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 int result1 = 2*24*60*60; System.out.println(result1); int result2 = 53*24*60*60; System.out.println(result2); } }

24th Feb 2021, 2:47 AM
Gabriella Martinez
Gabriella Martinez - avatar
5 Antworten
+ 6
Gabriella Martinez Don't write Hard Code logic because there maybe 1000 input so it will not be possible to write for all. Just do this int result = days * 24 * 60 * 60;
24th Feb 2021, 3:32 AM
A͢J
A͢J - avatar
+ 3
Gabriella Martinez Have you printed values? I just gave you solution but you have to print result.
24th Feb 2021, 3:41 AM
A͢J
A͢J - avatar
+ 2
There should only be 1 value output for this end of module project. All you need to do is multiply the number of days that are input by the number of seconds in a day (60 * 60 * 24 = 86400) and output that value.
24th Feb 2021, 3:24 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Ah, I’ve got it now. Thank you so much for your help!
24th Feb 2021, 3:49 AM
Gabriella Martinez
Gabriella Martinez - avatar
0
i feel stupid haha, but its saying I have no output now. Why would that be?
24th Feb 2021, 3:37 AM
Gabriella Martinez
Gabriella Martinez - avatar