Pārlūkot izejas kodu

Only Alices and Bobs allowed

NedRedmond 6 gadus atpakaļ
vecāks
revīzija
448adfdfed
4 mainītis faili ar 21 papildinājumiem un 8 dzēšanām
  1. Binārs
      Main.class
  2. 5
    0
      Main.ctxt
  3. 10
    2
      Main.java
  4. 6
    6
      package.bluej

Binārs
Main.class Parādīt failu


+ 5
- 0
Main.ctxt Parādīt failu

@@ -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

+ 10
- 2
Main.java Parādīt failu

@@ -1,9 +1,17 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
-public class Main {
4
+import java.util.*;
5 5
 
6
+public class Main {
6 7
     public static void main(String[] args ){
7
-
8
+        Scanner in = new Scanner(System.in);
9
+        System.out.print("Hey! What's your name?\n");
10
+        String name = in.next();
11
+        if (name.equalsIgnoreCase("Bob") || name.equalsIgnoreCase("Alice")) {
12
+            System.out.print("Welcome, " + name + "! It is good to see you.\n");
13
+        } else {
14
+            System.out.print(name + "??? Who are you? Bring me Bob or Alice.\n");
15
+        }
8 16
     }
9 17
 }

+ 6
- 6
package.bluej Parādīt failu

@@ -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=380
5
+editor.fx.0.y=97
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=178
13
+package.editor.y=92
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0