- 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
18 Answers
+ 7
Hi! Please, show us your code attempt! Thx!
+ 5
You have completed 32% of the JAVA course so go through your lessons again if you have forgotten some concepts
+ 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
+ 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);
}
}
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.
0
But over all Thank you Yaroslav Vernigora
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
0
This the problem I couldn't š©šYaroslav Vernigora
0
You know, how to print welcome message?
0
Yes I know
With (system.out.print )
0
System.out.printIn();
0
ok, before that, create a variable named age and make the value input using user input.
0
Ok
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
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
0
Oh
Ok
- 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?!
- 1
Atul yes u r right but ,i have complet it without any execution , so...