0

Pls answer for this question

Time converter. You need a program to convert days to seconds. The given code takes the amount of days as input. Complete the code to convert it to seconds and output the result. Sample Input: 12 Sample Output: 1036800 ( This is the code for Time Converter.. Pls Code the answer for it ) import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); System.out.println("enter the days"); String Seconds = scanner.nextLine(); System.out.println(Seconds ); } }

7th Dec 2021, 7:27 PM
Ifthiyaz Ahamed
Ifthiyaz Ahamed - avatar
1 Answer
+ 3
Ifthiyaz Ahamed There is only 1 input not 2. 1 day = 24 Hours 1 hour = 60 minutes 1 minute = 60 seconds First convert 1 day to second then multiply with given input.
7th Dec 2021, 7:36 PM
A͢J
A͢J - avatar