Pārlūkot izejas kodu

finished commit

Joshua Chung 8 gadus atpakaļ
vecāks
revīzija
fb6d05a871
4 mainītis faili ar 31 papildinājumiem un 9 dzēšanām
  1. Binārs
      Main.class
  2. 5
    0
      Main.ctxt
  3. 17
    0
      Main.java
  4. 9
    9
      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

+ 17
- 0
Main.java Parādīt failu

@@ -1,9 +1,26 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
+
5
+import java.util.Scanner;
6
+
4 7
 public class Main {
5 8
 
6 9
     public static void main(String[] args ){
10
+        Scanner user_input = new Scanner(System.in);
11
+        String name;
7 12
 
13
+        while(true){
14
+            System.out.print("Enter your name: ");
15
+            name = user_input.next();
16
+            
17
+            if(name.equals ("Alice")){
18
+                System.out.println("Hi Alice.");
19
+            }else if(name.equals ("Bob")){
20
+                System.out.println("Hi Bob.");
21
+            }else{
22
+                System.out.println("I don't know you.");
23
+            }
24
+        }
8 25
     }
9 26
 }

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

@@ -1,13 +1,13 @@
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
6
-objectbench.height=101
7
-objectbench.width=776
8
-package.divider.horizontal=0.6
9
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
2
+editor.fx.0.height=709
3
+editor.fx.0.width=800
4
+editor.fx.0.x=431
5
+editor.fx.0.y=23
6
+objectbench.height=226
7
+objectbench.width=284
8
+package.divider.horizontal=0.3730769230769231
9
+package.divider.vertical=0.5701107011070111
10
+package.editor.height=302
11 11
 package.editor.width=674
12 12
 package.editor.x=181
13 13
 package.editor.y=109