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.
5 Réponses
+ 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);
}
}
+ 3
Nobody is going to do your homework for you.
+ 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.
0
@CipherFox it is not a homework ;)
0
Google translate ;P