Kaynağa Gözat

comleted AliceAndBob

thulasi 6 yıl önce
ebeveyn
işleme
858078f138
4 değiştirilmiş dosya ile 32 ekleme ve 7 silme
  1. BIN
      Main.class
  2. 5
    0
      Main.ctxt
  3. 11
    1
      Main.java
  4. 16
    6
      package.bluej

BIN
Main.class Dosyayı Görüntüle


+ 5
- 0
Main.ctxt Dosyayı Görüntüle

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

+ 11
- 1
Main.java Dosyayı Görüntüle

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

+ 16
- 6
package.bluej Dosyayı Görüntüle

@@ -1,4 +1,7 @@
1 1
 #BlueJ package file
2
+dependency1.from=Main
3
+dependency1.to=CheckNames
4
+dependency1.type=UsesDependency
2 5
 editor.fx.0.height=0
3 6
 editor.fx.0.width=0
4 7
 editor.fx.0.x=0
@@ -13,8 +16,8 @@ package.editor.x=181
13 16
 package.editor.y=109
14 17
 package.frame.height=600
15 18
 package.frame.width=800
16
-package.numDependencies=0
17
-package.numTargets=1
19
+package.numDependencies=1
20
+package.numTargets=2
18 21
 package.showExtends=true
19 22
 package.showUses=true
20 23
 project.charset=UTF-8
@@ -24,9 +27,16 @@ readme.width=47
24 27
 readme.x=10
25 28
 readme.y=10
26 29
 target1.height=50
27
-target1.name=Main
30
+target1.name=CheckNames
28 31
 target1.showInterface=false
29 32
 target1.type=ClassTarget
30
-target1.width=80
31
-target1.x=70
32
-target1.y=10
33
+target1.width=110
34
+target1.x=340
35
+target1.y=60
36
+target2.height=50
37
+target2.name=Main
38
+target2.showInterface=false
39
+target2.type=ClassTarget
40
+target2.width=80
41
+target2.x=70
42
+target2.y=10