浏览代码

Alice& Bob

Nira Parikh 6 年前
父节点
当前提交
f96cac0f91
共有 4 个文件被更改,包括 36 次插入13 次删除
  1. 二进制
      Main.class
  2. 5
    0
      Main.ctxt
  3. 21
    3
      Main.java
  4. 10
    10
      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

+ 21
- 3
Main.java 查看文件

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

+ 10
- 10
package.bluej 查看文件

@@ -1,17 +1,17 @@
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=709
3
+editor.fx.0.width=800
4
+editor.fx.0.x=480
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
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
9
+package.divider.vertical=0.7567567567567568
10
+package.editor.height=329
11 11
 package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
14
-package.frame.height=600
12
+package.editor.x=480
13
+package.editor.y=118
14
+package.frame.height=502
15 15
 package.frame.width=800
16 16
 package.numDependencies=0
17 17
 package.numTargets=1