Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class MyChatterBox {
  4.  
  5. public static void main(String[] args) {
  6.  
  7. // Just some input/output stuff to get used to this syntax.
  8.  
  9. Scanner S = new Scanner(System.in);
  10. System.out.println("Hello! What is your name?");
  11. String name = S.nextLine();
  12. System.out.println("Nice to meet you, " + name + "! How are you?");
  13.  
  14. Scanner age = new Scanner(System.in);
  15. System.out.println("How old are you?");
  16. String myAge = age.nextLine();
  17. System.out.println(myAge + "!? You're a youngster!");
  18.  
  19. Scanner hobby = new Scanner(System.in);
  20. System.out.println("What do you like to do during your free time?");
  21. String myHobby = hobby.nextLine();
  22. System.out.println(myHobby + "? Sounds like a lot of fun!");
  23.  
  24. Scanner location = new Scanner(System.in);
  25. System.out.println("Where do you live?");
  26. String myLocation = location.nextLine();
  27. System.out.println("That's one hell of a commute to Newark.");
  28.  
  29. Scanner subject = new Scanner(System.in);
  30. System.out.println("What subjects are you interested in?");
  31. String mySubject = subject.nextLine();
  32. System.out.println("Jeez, you're into " + mySubject + "? What a nerd!");
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement