Browse Source

Greetings for Alice and Bob

Christian Sheridan 6 years ago
parent
commit
1a00924ee7
3 changed files with 14 additions and 3 deletions
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 9
    3
      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

+ 9
- 3
Main.java View File

@@ -1,9 +1,15 @@
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 ){
7
-
8
-    }
8
+    Scanner in = new Scanner(System.in);
9
+    System.out.print("please enter your first name");
10
+    String firstName = in.nextLine();
11
+    if (firstName.equals ("Alice") || firstName.equals("Bob")){
12
+    System.out.println("Greetings! " + firstName);
9 13
 }
14
+    }
15
+}