1234567891011121314151617181920212223242526272829303132333435363738 |
- /**
- * Created by iyasuwatts on 10/17/17.
- */
-
- import java.util.Scanner;
-
- public class Main {
-
- public static void verifyIdentity ()
- {
- Scanner input = new Scanner(System.in);
-
- String name;
- System.out.println("What is your first name? ");
- name = input.next();
-
- if (name.equalsIgnoreCase("Alice")) {
- System.out.println("Hello, Alice!");
- } else if (name.equalsIgnoreCase("Bob")) {
- System.out.println("Hello, Bob!");
- } else if (name.equalsIgnoreCase("Robert")) {
-
- Scanner rob = new Scanner(System.in);
- System.out.println("Do people sometimes call you Bob? ");
- String yas = rob.nextLine();
-
- if (yas.equalsIgnoreCase("Yes")) {
- System.out.println("Great! Hello, Bob!");
- } else if (yas.equalsIgnoreCase("No")) {
- System.out.println("Too bad. Bye.");
- }
-
- } else {
- System.out.println("You are not welcome here, " + name + ".");
- }
- }
- }
|