Can u help me guys in this?! 🙏😩 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Can u help me guys in this?! 🙏😩

Write a Java program that receives the user's age in years and then outputs a welcome message with the user's name and age in months, days and hours

2nd Jun 2021, 8:59 AM
Nazik Aljilee
18 Answers
+ 7
Hi! Please, show us your code attempt! Thx!
2nd Jun 2021, 9:03 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 5
You have completed 32% of the JAVA course so go through your lessons again if you have forgotten some concepts
2nd Jun 2021, 9:54 AM
Atul [Inactive]
+ 1
you should have at least a basic understanding of what operators, variables, and basic language constructs are. you should be able to write the simplest program. then maybe we can help you. otherwise, start your training course again
2nd Jun 2021, 12:27 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
import java.util.Scanner; public class username { public static void main(String args[]) throws Exception { String name; int age; Scanner SC=new Scanner(System.in); System.out.print("Enter name: "); name= SC.nextLine() System.out.print("Enter age: "); age=SC.nextInt() System.out.println("Name: " + name); System.out.println("Age: " + age); } }
3rd Jun 2021, 1:55 AM
choco
0
Yaroslav Vernigora all i know that we didn't take so many things the basic ,like loops ,(for, while,do while) , condition (if, if else, switch) operaters ( &,||)data type (integers , float, double , charters ) this is all what I got.
2nd Jun 2021, 4:41 PM
Nazik Aljilee
0
But over all Thank you Yaroslav Vernigora
2nd Jun 2021, 4:42 PM
Nazik Aljilee
0
in this case, if you know so much, then you are able to write this program. it's very simple. only I think the condition is missing in addition to entering the user's age, the input data of the current time, date, year and month
2nd Jun 2021, 4:48 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
This the problem I couldn't 😩💔Yaroslav Vernigora
2nd Jun 2021, 4:57 PM
Nazik Aljilee
0
You know, how to print welcome message?
2nd Jun 2021, 4:59 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Yes I know With (system.out.print )
2nd Jun 2021, 5:01 PM
Nazik Aljilee
0
System.out.printIn();
2nd Jun 2021, 5:08 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
ok, before that, create a variable named age and make the value input using user input.
2nd Jun 2021, 5:09 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Ok
2nd Jun 2021, 5:33 PM
Nazik Aljilee
0
import java.util.Scanner ; class Program { public static void main(String[] args) { } Scanner age=new Scanner(System.in); System.out.println(welcome;) } Is it true over here?!Yaroslav Vernigora
2nd Jun 2021, 5:48 PM
Nazik Aljilee
0
not quite, the word welcome take in quotes, as this string value. age do as input (need to add another line code) think what. and this will be a type of integer, numeric value
2nd Jun 2021, 6:12 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Oh Ok
2nd Jun 2021, 6:52 PM
Nazik Aljilee
- 1
Hey Yaroslav Vernigora i am sorry ,i am new in all this things I have nothing just this assignment , i have ordered to do it , so I have no code , can I get help?! İs it tough?!
2nd Jun 2021, 11:50 AM
Nazik Aljilee
- 1
Atul yes u r right but ,i have complet it without any execution , so...
2nd Jun 2021, 11:54 AM
Nazik Aljilee