Browse Source

I have a message for Alice and Bob

Akeem Cherry 6 years ago
parent
commit
af84402dc9
4 changed files with 22 additions and 5 deletions
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 12
    0
      Main.java
  4. 5
    5
      package.bluej

BIN
Main.class View File


+ 5
- 0
Main.ctxt View File

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

+ 12
- 0
Main.java View File

1
 /**
1
 /**
2
  * Created by iyasuwatts on 10/17/17.
2
  * Created by iyasuwatts on 10/17/17.
3
  */
3
  */
4
+import java.util.Scanner;
4
 public class Main {
5
 public class Main {
5
 
6
 
6
     public static void main(String[] args ){
7
     public static void main(String[] args ){
7
 
8
 
9
+    Scanner in = new Scanner(System.in);
10
+    System.out.print("What is your name? ");
11
+    
12
+    String firstName = in.nextLine();
13
+    if(firstName.equals("Alice")){
14
+        System.out.println("Hello Alice");
15
+    }   
16
+    if(firstName.equals("Bob")){
17
+        System.out.println("Hello Bob");
8
     }
18
     }
9
 }
19
 }
20
+}
21
+

+ 5
- 5
package.bluej View File

1
 #BlueJ package file
1
 #BlueJ package file
2
-editor.fx.0.height=0
3
-editor.fx.0.width=0
4
-editor.fx.0.x=0
5
-editor.fx.0.y=0
2
+editor.fx.0.height=716
3
+editor.fx.0.width=800
4
+editor.fx.0.x=443
5
+editor.fx.0.y=23
6
 objectbench.height=101
6
 objectbench.height=101
7
 objectbench.width=776
7
 objectbench.width=776
8
 package.divider.horizontal=0.6
8
 package.divider.horizontal=0.6
27
 target1.name=Main
27
 target1.name=Main
28
 target1.showInterface=false
28
 target1.showInterface=false
29
 target1.type=ClassTarget
29
 target1.type=ClassTarget
30
-target1.width=80
30
+target1.width=90
31
 target1.x=70
31
 target1.x=70
32
 target1.y=10
32
 target1.y=10