How to solve the first java project | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 6

How to solve the first java project

Java first project

8th Dec 2020, 8:38 AM
Tharindu Madusanka
Tharindu Madusanka - avatar
19 ответов
0
whaaaaat? where is your code?
8th Dec 2020, 9:20 AM
Rellot's screwdriver
Rellot's screwdriver - avatar
0
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); } } Time converter : days to seconds
8th Dec 2020, 12:50 PM
Tharindu Madusanka
Tharindu Madusanka - avatar
0
I didn't get it😕
8th Dec 2020, 2:32 PM
Tharindu Madusanka
Tharindu Madusanka - avatar
0
yeah I know to do it from mathematically but don't understand turn into codes
8th Dec 2020, 3:03 PM
Tharindu Madusanka
Tharindu Madusanka - avatar
0
You don't understand. That's normal. But the point is you have to try. Review lessons and try to write some code. Spend maybe 10 or 30 minutes and try to write some lines of code.
8th Dec 2020, 3:15 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Int days = ??
8th Dec 2020, 3:52 PM
Tharindu Madusanka
Tharindu Madusanka - avatar
0
You already defined the input. int result =days* X * Y * Z; System.out.println(result); That's it!
8th Dec 2020, 3:54 PM
Simba
Simba - avatar
0
Thank you!
8th Dec 2020, 3:55 PM
Tharindu Madusanka
Tharindu Madusanka - avatar
0
Ok...you don't need to think a lot in this if you know the basics of java.... As you know how to convert it mathematically so it's just easy as that.... You do multiplication for converting it from days to seconds same is here apply the multiply operator(*) to convert and than print it.... Please try it to solve your self ones than also if it is wrong than see my code... I recommend you to try by yourself to learn more..... My code is: 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); } } Hope so it helps....👍👍
10th Dec 2020, 7:22 AM
Abhinav Raj
Abhinav Raj - avatar
0
Thanks
12th Dec 2020, 12:00 PM
Tharindu Madusanka
Tharindu Madusanka - avatar
0
Ok...you don't need to think a lot in this if you know the basics of java.... As you know how to convert it mathematically so it's just easy as that.... You do multiplication for converting it from days to seconds same is here apply the multiply operator(*) to convert and than print it.... Please try it to solve your self ones than also if it is wrong than see my code... I recommend you to try by yourself to learn more..... My code is: 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); } } Hope so it helps....👍👍
30th Aug 2021, 3:12 PM
bahiyah aisyah
0
Have tried it like different 59 ways. Believe me I tried. What is the answer? So I can understand why I'm doing something. or everybody in this community are like aaa it's so easy try more
19th Dec 2021, 6:55 PM
Henry
0
My trying for I thing 40 of time import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); int hours = int day(2*24) int min = int hours(48*60) int sec = int min System.out.println(int sec) //your code goes here } }
19th Dec 2021, 7:13 PM
Henry
0
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int days = scanner.nextInt(); int result = days*24*60*60 System.out.println(result) //your code goes here } } What's wrong??
19th Dec 2021, 7:20 PM
Henry
0
Henry put semicolon in the last two lines
20th Dec 2021, 8:42 AM
Abhinav Raj
Abhinav Raj - avatar
0
Thanks and regards my friend. Always something I miss, but I'm just a noob right now. So thank you again Abhinav Raj. 🙏
20th Dec 2021, 10:02 AM
Henry
- 1
Where's your attempt?
8th Dec 2020, 9:26 AM
你知道規則,我也是
你知道規則,我也是 - avatar
- 1
Tharindu Madusanka why you stopped there? Complete code.. Find 1 minute = 60 seconds. 1 hour = 60 minutes = 60*60 seconds 1 day = 24 hours. = x? n days has x*n seconds..
8th Dec 2020, 2:27 PM
Jayakrishna 🇮🇳
- 1
int X = 24; int Y = 60; int Z = 60; int result = X * Y * Z; System.out.println(result); This says wrong
8th Dec 2020, 3:47 PM
Tharindu Madusanka
Tharindu Madusanka - avatar