- 1

Can anyone please help me in java

"Time Converter program" 12days have to convert in seconds

12th Jan 2021, 3:56 PM
Bhavesh Sove
Bhavesh Sove - avatar
17 ответов
+ 10
Bhavesh Sove How many second in one minute? How many minutes in one hours? How many hours in one days? If you know this then you can solve how many seconds in 24 hours. If you get seconds of 1 day then you can get of 12 days.
12th Jan 2021, 4:00 PM
A͢J
A͢J - avatar
+ 5
Bhavesh Sove Just read the explanation of that problem which is in yellow colored box . https://www.sololearn.com/coach/948?ref=app
12th Jan 2021, 4:15 PM
NavyaSri
NavyaSri - avatar
+ 3
Then use your mathematical knowledge Hint: ``` x = 60 y = 60x z = 24y ```
12th Jan 2021, 4:22 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 2
searching 'days to seconds conversation formula' in google gives you helpful answer
12th Jan 2021, 4:06 PM
Ananiya Jemberu
Ananiya Jemberu - avatar
+ 2
Thanks everyone ❤️ Special thanks to #yashraj
13th Jan 2021, 9:36 AM
Bhavesh Sove
Bhavesh Sove - avatar
+ 2
It will solve your problem!Use it. import java.util.Scanner; public class DaysToSeconds{ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); int hours = 24; int minutes = 60; int seconds = 60; System.out.println(days*hours*minutes*seconds); } }
13th Jan 2021, 7:29 PM
Владислав Кадыгроб
Владислав Кадыгроб - avatar
+ 2
import java.util.Scanner; public class MathUnitConversions13 { 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"); } }
14th Jan 2021, 2:10 AM
Siddhart
Siddhart - avatar
+ 2
First make use of package then make class,then method main then scanner then 👇👇 int days = scanner.nextInt(); int sec=days*24*60*60; System.out.println(sec); I am telling you this because earlier I was also weak in programing 😅😅😅😅. Final code should be 👇👇👇👇 import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); int sec=days*24*60*60; System.out.println(sec); } }
14th Jan 2021, 1:48 PM
Utkarsh Malasi
Utkarsh Malasi - avatar
13th Jan 2021, 6:50 AM
Yashraj Rastogi
Yashraj Rastogi - avatar
13th Jan 2021, 7:57 PM
Владислав Кадыгроб
Владислав Кадыгроб - avatar
+ 1
in one hour there are 84600 seconds, so the algorithm becomes. Import Java.util.Scanner; Public class Con sec{ Public static void main(String[] args){ Int day = sc.nextInt(); Int sec = day * 84600; System.out.print(sec); } }
13th Jan 2021, 10:57 PM
GiobirCode
GiobirCode - avatar
0
I know there are - 24hrs in a day 60min in hour 60sec in min But I don't know the method for coding in Java I am confused 🙄
12th Jan 2021, 4:10 PM
Bhavesh Sove
Bhavesh Sove - avatar
0
int num1 = days; int num2 =num1*24; int num3 =num2*60; int num4 =num3*60; System.out.println(num4);
12th Jan 2021, 4:45 PM
Motuncoded
Motuncoded - avatar
0
public class Program { public static int secondsConvertor(int days){ int sec,mins,hours=24; mins=60; sec=60; return days*hours*mins*sec;}; public static void main(String[] args) { System.out.print(secondsConvertor(12)); } }
12th Jan 2021, 5:38 PM
D_Stark
D_Stark - avatar
0
You are most welcome!Bhavesh Sove
13th Jan 2021, 9:50 AM
Yashraj Rastogi
Yashraj Rastogi - avatar
0
Got it
13th Jan 2021, 11:12 AM
Yahya Abdallah
0
In this lab, you are going to draw some Ascii Art using a two dimensional array. When dealing with multi-dimensional arrays, you’ll typically use nested loops (i.e. a loop within a loop). The outer loop typically iterates over the rows of the array, while the inner loop typically iterates over the columns. A two dimensional array uses two indexes. The first index represents the row number, while the second index represents the column. For example: myArray[0][1] refers to the first row (0) and the second column (1). Can someone help me with this problem?
14th Jan 2021, 2:04 PM
Mark Anthony Johnson