|
@@ -1,9 +1,27 @@
|
1
|
1
|
/**
|
2
|
2
|
* Created by iyasuwatts on 10/17/17.
|
3
|
3
|
*/
|
|
4
|
+import java.util.Scanner;
|
4
|
5
|
public class Main {
|
5
|
6
|
|
6
|
7
|
public static void main(String[] args ){
|
|
8
|
+ Scanner input = new Scanner(System.in);
|
|
9
|
+ //prompt the user to enter name
|
|
10
|
+ System.out.println(" Please Enter your Name:");
|
7
|
11
|
|
|
12
|
+ String name;
|
|
13
|
+ name=input.next();
|
|
14
|
+ // if statement to output a greatting to Allice
|
|
15
|
+ if ( name.equals("Alice")){
|
|
16
|
+ System.out.println("Welcome" + name +" to the world of Java" );
|
|
17
|
+ }
|
|
18
|
+
|
|
19
|
+ // gretting stament for Bob
|
|
20
|
+ else if (name.equals("Bob")) {
|
|
21
|
+ System.out.println("welcome" + name+ "to the world of Java");}
|
|
22
|
+// if the name is not Alice or Bob
|
|
23
|
+ else {
|
|
24
|
+ System.out.println("Sorry, you dont belong here!");
|
|
25
|
+ }
|
8
|
26
|
}
|
9
|
27
|
}
|