0
Is dis code for a time converter correct ... If no show me what I did wrong
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); int input = 2; int hour=24; int minute= 60; int second=60; int sec =(hour*minute*second*input); System.out.println(""+sec ); } } import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); int input2 = 2; int hour2=24; int minute2= 60; int second2=60; int sec2 =(hour2*minute2*second2*input2); System.out.println(""+sec2 );
2 odpowiedzi
+ 2
You only need the class 1 time. Remove all other classes.
All you need to do is output the days times hours times minutes times seconds. Remove the variable "int input = 2;" from your first class. In your sec calculation replace 'input' with 'days' and that should fix it.
+ 1
ChaoticDawg
Thanks
Let me try dat