Kaynağa Gözat

Said hi to Alice and Bob

Kate Moore 6 yıl önce
ebeveyn
işleme
773a9263b8
4 değiştirilmiş dosya ile 33 ekleme ve 7 silme
  1. BIN
      Main.class
  2. 8
    0
      Main.ctxt
  3. 19
    1
      Main.java
  4. 6
    6
      package.bluej

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


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

@@ -0,0 +1,8 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment0.text=\n\ Created\ by\ iyasuwatts\ on\ 10/17/17.\n
4
+comment1.params=args
5
+comment1.target=void\ main(java.lang.String[])
6
+comment2.params=
7
+comment2.target=void\ getName()
8
+numComments=3

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

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

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

@@ -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=479
5
+editor.fx.0.y=23
6 6
 objectbench.height=101
7 7
 objectbench.width=776
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=0
13
+package.editor.y=124
14 14
 package.frame.height=600
15 15
 package.frame.width=800
16 16
 package.numDependencies=0