123456789101112131415161718192021222324252627
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. public static void main(String[] args ){
  7. Scanner scan = new Scanner(System.in);
  8. String name = "";
  9. do {
  10. System.out.println("What is your name?");
  11. name = scan.next();
  12. if (name.equalsIgnoreCase("Alice")) {
  13. System.out.println("Hey Alice!!");
  14. } else if (name.equalsIgnoreCase("Bob")) {
  15. System.out.println("What's up, Bob!");
  16. } else {
  17. System.out.println("Who is that?? Man, I don't know you!!");
  18. }
  19. } while (!name.equalsIgnoreCase("Alice") &&
  20. !name.equalsIgnoreCase("Bob"));
  21. }
  22. }