0

I need help to create a program where he first ask you "What's your name?: " and then it gives you as output "Hello (name)"

for example: //outputs what's your name?: -(input name)- Hello -(name)- I need it in java language pls.

8th Jan 2018, 5:57 PM
Alessandro
Alessandro - avatar
5 Antworten
+ 3
import java.util.Scanner; class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("What's your name?: "); String name = sc.nextLine(); System.out.println("Hello " + name); } }
8th Jan 2018, 6:16 PM
Al Toe
+ 3
Nobody is going to do your homework for you.
8th Jan 2018, 6:12 PM
Fox
Fox - avatar
+ 3
Then what is it? When you say "he", who are you referring to? The post is asking for a program in a way you'd order food at a drive-through, lol. There doesn't seem to be an attempt at coding it yourself, so am I in the wrong to assume that it's homework? Lol.
8th Jan 2018, 9:12 PM
Fox
Fox - avatar
0
@CipherFox it is not a homework ;)
8th Jan 2018, 6:22 PM
Alessandro
Alessandro - avatar
0
Google translate ;P
8th Jan 2018, 9:14 PM
Alessandro
Alessandro - avatar