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