Sfoglia il codice sorgente

AliceAndBob complete#

Donna Jacobs 6 anni fa
parent
commit
26622650e7
4 ha cambiato i file con 22 aggiunte e 5 eliminazioni
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 12
    0
      Main.java
  4. 5
    5
      package.bluej

BIN
Main.class Vedi File


+ 5
- 0
Main.ctxt Vedi File

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

+ 12
- 0
Main.java Vedi File

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

+ 5
- 5
package.bluej Vedi File

@@ -1,10 +1,10 @@
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=714
3
+editor.fx.0.width=800
4
+editor.fx.0.x=240
5
+editor.fx.0.y=23
6 6
 objectbench.height=101
7
-objectbench.width=776
7
+objectbench.width=461
8 8
 package.divider.horizontal=0.6
9 9
 package.divider.vertical=0.8007380073800738
10 10
 package.editor.height=427