|
@@ -0,0 +1,22 @@
|
|
1
|
+/**
|
|
2
|
+ * Created by iyasuwatts on 10/17/17.
|
|
3
|
+ */
|
|
4
|
+import java.util.*;
|
|
5
|
+public class Greeting {
|
|
6
|
+
|
|
7
|
+ public static void main(String[] args ){
|
|
8
|
+ }
|
|
9
|
+ public void sayHi(){
|
|
10
|
+ Scanner wordTyped = new Scanner(System.in);
|
|
11
|
+ System.out.println("What is your name");
|
|
12
|
+ String name = wordTyped.nextLine();
|
|
13
|
+ if (name.equals("Alice")) {
|
|
14
|
+ System.out.println("Hi Alice!");
|
|
15
|
+ } else if (name.equals("Bob")){
|
|
16
|
+ System.out.println("Hi Bob!");
|
|
17
|
+ } else {
|
|
18
|
+ System.out.println("Go away, this program is only for Alice and Bob!");
|
|
19
|
+ }
|
|
20
|
+
|
|
21
|
+ }
|
|
22
|
+}
|