Bläddra i källkod

Alice and Bob

Simran Bhutani 6 år sedan
förälder
incheckning
03ab3ebe9b
2 ändrade filer med 24 tillägg och 7 borttagningar
  1. 17
    0
      Main.java
  2. 7
    7
      package.bluej

+ 17
- 0
Main.java Visa fil

@@ -1,9 +1,26 @@
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 ){
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 Visa fil

@@ -1,16 +1,16 @@
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=722
3
+editor.fx.0.width=800
4
+editor.fx.0.x=588
5
+editor.fx.0.y=92
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
11 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 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0