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); } }
5 Respostas
+ 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;
+ 3
Gabriella Martinez
Have you printed values? I just gave you solution but you have to print result.
+ 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.
+ 2
Ah, I’ve got it now. Thank you so much for your help!
0
i feel stupid haha, but its saying I have no output now. Why would that be?