+ 3

Can someone show me how to solve this?

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. 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 } }

11th Feb 2022, 2:59 PM
Renz Malayan Cole
Renz Malayan Cole - avatar
7 Antworten
+ 2
** you need to calculate seconds for input days ** print the result. If you ask how, still then 'You need to complete lessons.. ' it's there how to do with example... Here you need just a simple output statement which prints output. Task will complete. Hope now you can ! Renz Malayan Cole ?
11th Feb 2022, 3:15 PM
Jayakrishna 🇮🇳
+ 3
A day have 24hours A hour has 60 mins A minute has 60 seconds what else you need?
11th Feb 2022, 3:02 PM
Jayakrishna 🇮🇳
+ 3
Jayakrishna🇮🇳 i already know that but just don't know how to write the code,
11th Feb 2022, 3:10 PM
Renz Malayan Cole
Renz Malayan Cole - avatar
+ 2
Then you should first learn how to write code.
11th Feb 2022, 3:15 PM
A͢J
A͢J - avatar
+ 2
int ans=days*24*3600; because day=24h h=60 min min=60 sic
11th Feb 2022, 4:59 PM
Mohammad al ayoubi
Mohammad al ayoubi - avatar
0
Manav Roy ok got it thanks
11th Feb 2022, 11:49 PM
Renz Malayan Cole
Renz Malayan Cole - avatar
0
Thank you all finally got the right code for the problem 😊
12th Feb 2022, 12:33 AM
Renz Malayan Cole
Renz Malayan Cole - avatar