- 13
Time converter
How to make this program time converter help me. Exp:12 days are 12*24=288 hours,which are 288*60=17280 minutes,which are 17280*60=1036800 seconds. Plz answer.
6 Answers
+ 2
import java.util.Scanner;
public class DayToSecondsConversion {
public static void main(String[] args) {
long days;
Scanner in = new Scanner(System.in);
System.out.println("Please enter days:");
days = in.nextLong();
long seconds = days * 24 * 60 * 60; System.out.println(seconds + " Seconds");
}
}
0
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 hours = days*24;
int minute = hours*60;
int seconds = minute*60;
System.out.println (seconds);
}
}
May this help you
0
import java.util.Scanner;
public class DayToSecondsConversion {
public static void main(String[] args) {
long days;
Scanner in = new Scanner(System.in);
System.out.println("Please enter days:");
days = in.nextLong();
long seconds = days * 24 * 60 * 60; System.out.println(seconds + " Seconds");
}
}
0
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
int d =2;
int h = d*24;
int m = h*60;
int s = m*60;
System.out.println(s);
}
}
0
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
int prod = days * 24;
int prod1 = prod * 60;
int prod2 = prod1 * 60;
System.out.println(prod2);
}
}
0
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int days = scanner.nextInt();
int prod = days * 24;
int prod1 = prod * 60;
int prod2 = prod1 * 60;
System.out.println(prod2);
}
}
Good Luck