浏览代码

Alice and Bob

Simran Bhutani 6 年前
父节点
当前提交
03ab3ebe9b
共有 2 个文件被更改,包括 24 次插入7 次删除
  1. 17
    0
      Main.java
  2. 7
    7
      package.bluej

+ 17
- 0
Main.java 查看文件

1
 /**
1
 /**
2
  * Created by iyasuwatts on 10/17/17.
2
  * Created by iyasuwatts on 10/17/17.
3
  */
3
  */
4
+import java.util.*;
4
 public class Main {
5
 public class Main {
5
 
6
 
6
     public static void main(String[] args ){
7
     public static void main(String[] args ){
8
+       
9
+       
10
+        Scanner in= new Scanner(System.in);
11
+        System.out.println("What is your name?");
12
+        String name= in.nextLine();
13
+        if (name.equals( "Bob"))
14
+        {
15
+            System.out.println("Hello Bob");
7
 
16
 
8
     }
17
     }
18
+    else if(name.equals ("Alice"))
19
+    { 
20
+        System.out.println("Hello Alice");
21
+    }
22
+    else {
23
+        System.out.println("You are not Alice and Bob");
24
+}
9
 }
25
 }
26
+}

+ 7
- 7
package.bluej 查看文件

1
 #BlueJ package file
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=722
3
+editor.fx.0.width=800
4
+editor.fx.0.x=588
5
+editor.fx.0.y=92
6
 objectbench.height=101
6
 objectbench.height=101
7
-objectbench.width=776
7
+objectbench.width=461
8
 package.divider.horizontal=0.6
8
 package.divider.horizontal=0.6
9
 package.divider.vertical=0.8007380073800738
9
 package.divider.vertical=0.8007380073800738
10
 package.editor.height=427
10
 package.editor.height=427
11
 package.editor.width=674
11
 package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
12
+package.editor.x=118
13
+package.editor.y=196
14
 package.frame.height=600
14
 package.frame.height=600
15
 package.frame.width=800
15
 package.frame.width=800
16
 package.numDependencies=0
16
 package.numDependencies=0