Browse Source

This is the completed Lab

De'Jon Johnson 6 years ago
parent
commit
d96833a82a
3 changed files with 22 additions and 1 deletions
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 17
    1
      Main.java

BIN
Main.class View File


+ 5
- 0
Main.ctxt View File

@@ -0,0 +1,5 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=args
4
+comment1.target=void\ main(java.lang.String[])
5
+numComments=2

+ 17
- 1
Main.java View File

@@ -1,9 +1,25 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
+import java.util.*;
4 5
 public class Main {
5 6
 
6 7
     public static void main(String[] args ){
7
-
8
+        Scanner response = new Scanner(System.in);
9
+        
10
+        System.out.println("What's your name? ");
11
+        for(int i=0; i<5;i++){
12
+        String RespondersName = response.nextLine();
13
+        
14
+        if (RespondersName.equals("Bob")  || RespondersName.equals("bob") ||RespondersName.equals("BOB")) {
15
+            System.out.println("Greetings " + RespondersName);
16
+             //break;
17
+        } else if (RespondersName.equals("alice") || RespondersName.equals("Alice") || RespondersName.equals("ALICE")){
18
+          System.out.println("Greetings " + RespondersName);
19
+             //break;
20
+        } else {
21
+        System.out.println("Your name is not Alice or Bob");
22
+       }
23
+    }
8 24
     }
9 25
 }