Quellcode durchsuchen

Added a name greater

William Brown vor 6 Jahren
Ursprung
Commit
9233f6a0bd
2 geänderte Dateien mit 18 neuen und 8 gelöschten Zeilen
  1. 12
    2
      Main.java
  2. 6
    6
      package.bluej

+ 12
- 2
Main.java Datei anzeigen

@@ -1,9 +1,19 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
+import java.util.*;
5
+
4 6
 public class Main {
5 7
 
6 8
     public static void main(String[] args ){
7
-
9
+        Scanner scanner = new Scanner(System.in);
10
+        System.out.println("What's your name");
11
+        String name = scanner.nextLine();
12
+        if(name.equalsIgnoreCase("Bob")){
13
+            System.out.println("Well, Hello there " + name);
14
+        } else if(name.equalsIgnoreCase("Alice")){
15
+            System.out.println("Well, Hello there " + name);
16
+        } else 
17
+            System.out.println("Try again.");
8 18
     }
9
-}
19
+}

+ 6
- 6
package.bluej Datei anzeigen

@@ -1,16 +1,16 @@
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=240
5
+editor.fx.0.y=23
6 6
 objectbench.height=101
7 7
 objectbench.width=776
8 8
 package.divider.horizontal=0.6
9 9
 package.divider.vertical=0.8007380073800738
10 10
 package.editor.height=427
11 11
 package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
12
+package.editor.x=56
13
+package.editor.y=79
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0