1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Created by iyasuwatts on 10/17/17.
  3. */
  4. import java.util.Scanner;
  5. public class Main {
  6. public static void verifyIdentity ()
  7. {
  8. Scanner input = new Scanner(System.in);
  9. String name;
  10. System.out.println("What is your first name? ");
  11. name = input.next();
  12. if (name.equalsIgnoreCase("Alice")) {
  13. System.out.println("Hello, Alice!");
  14. } else if (name.equalsIgnoreCase("Bob")) {
  15. System.out.println("Hello, Bob!");
  16. } else if (name.equalsIgnoreCase("Robert")) {
  17. Scanner rob = new Scanner(System.in);
  18. System.out.println("Do people sometimes call you Bob? ");
  19. String yas = rob.nextLine();
  20. if (yas.equalsIgnoreCase("Yes")) {
  21. System.out.println("Great! Hello, Bob!");
  22. } else if (yas.equalsIgnoreCase("No")) {
  23. System.out.println("Too bad. Bye.");
  24. }
  25. } else {
  26. System.out.println("You are not welcome here, " + name + ".");
  27. }
  28. }
  29. }