浏览代码

comleted AliceAndBob

thulasi 6 年前
父节点
当前提交
858078f138
共有 4 个文件被更改,包括 32 次插入7 次删除
  1. 二进制
      Main.class
  2. 5
    0
      Main.ctxt
  3. 11
    1
      Main.java
  4. 16
    6
      package.bluej

二进制
Main.class 查看文件


+ 5
- 0
Main.ctxt 查看文件

@@ -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 查看文件

@@ -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 查看文件

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