Bladeren bron

Curtis Cook's Alice And Bob Lab

Curtis Cook 6 jaren geleden
bovenliggende
commit
4883500c36
4 gewijzigde bestanden met toevoegingen van 22 en 7 verwijderingen
  1. BIN
      Main.class
  2. 6
    0
      Main.ctxt
  3. 12
    3
      Main.java
  4. 4
    4
      package.bluej

BIN
Main.class Bestand weergeven


+ 6
- 0
Main.ctxt Bestand weergeven

@@ -0,0 +1,6 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment0.text=\n\ Created\ by\ iyasuwatts\ on\ 10/17/17.\n
4
+comment1.params=args
5
+comment1.target=void\ main(java.lang.String[])
6
+numComments=2

+ 12
- 3
Main.java Bestand weergeven

@@ -1,9 +1,18 @@
1
+import java.util.*;
2
+
1 3
 /**
2 4
  * Created by iyasuwatts on 10/17/17.
3 5
  */
4 6
 public class Main {
5
-
6
-    public static void main(String[] args ){
7
-
7
+    
8
+    public static void main(String[] args ) { 
9
+        Scanner in = new Scanner(System.in);
10
+        System.out.println("Please enter your name.");
11
+        String name = in.nextLine();
12
+        if(name.equalsIgnoreCase("Alice") || name.equalsIgnoreCase("Bob")) {
13
+            System.out.println("Hello " + name + ". Nice to meet you!");
14
+        } else {
15
+            System.out.println("Sorry, " + name + " I'm looking for someone else.");
16
+        }
8 17
     }
9 18
 }

+ 4
- 4
package.bluej Bestand weergeven

@@ -1,8 +1,8 @@
1 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=722
3
+editor.fx.0.width=800
4
+editor.fx.0.x=320
5
+editor.fx.0.y=75
6 6
 objectbench.height=101
7 7
 objectbench.width=776
8 8
 package.divider.horizontal=0.6