- 2

I need Java solution

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 Explanation: 12 days are 12*24 = 288 hours, which are 288*60 = 17280 minutes, which are 17280*60 = 1036800 seconds.

21st Apr 2022, 2:02 AM
Gabriel Walim
Gabriel Walim - avatar
6 Réponses
+ 4
Gabriel Walim 1 day = 24 hours 1 hour = 60 minutes 1 minute = 60 seconds Now convert days to seconds by multiplying days with hours, minutes and seconds Take days as user input.
21st Apr 2022, 3:08 AM
A͢J
A͢J - avatar
+ 1
What's wrong with your code? Can you copy and paste it into the code playground and then share it here?
21st Apr 2022, 2:06 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
We are not a hand you a code for your homework site. I suggest you actually practice what you know and figure it out. If you have a code that is broken, we will fix it for you. But, four homework like questions in two hours is too many.
21st Apr 2022, 2:08 AM
John Wells
John Wells - avatar
0
Ok
21st Apr 2022, 2:10 AM
Gabriel Walim
Gabriel Walim - avatar
0
Boss i finished learning all lessons it left with the practice program
21st Apr 2022, 2:13 AM
Gabriel Walim
Gabriel Walim - avatar
- 1
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 } }
21st Apr 2022, 2:13 AM
Gabriel Walim
Gabriel Walim - avatar