- 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.
6 Answers
+ 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.
+ 1
What's wrong with your code? Can you copy and paste it into the code playground and then share it here?
+ 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.
0
Ok
0
Boss i finished learning all lessons it left with the practice program
- 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
}
}