Pārlūkot izejas kodu

Tested Alice & Bob

Chaitali Patel 6 gadus atpakaļ
vecāks
revīzija
c991acc056
4 mainītis faili ar 27 papildinājumiem un 7 dzēšanām
  1. Binārs
      Main.class
  2. 7
    0
      Main.ctxt
  3. 15
    2
      Main.java
  4. 5
    5
      package.bluej

Binārs
Main.class Parādīt failu


+ 7
- 0
Main.ctxt Parādīt failu

@@ -0,0 +1,7 @@
1
+#BlueJ class context
2
+comment0.target=Main
3
+comment1.params=args
4
+comment1.target=void\ main(java.lang.String[])
5
+comment2.params=
6
+comment2.target=void\ greeting()
7
+numComments=3

+ 15
- 2
Main.java Parādīt failu

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

+ 5
- 5
package.bluej Parādīt failu

@@ -1,15 +1,15 @@
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=450
3
+editor.fx.0.width=659
4
+editor.fx.0.x=467
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
12
+package.editor.x=376
13 13
 package.editor.y=109
14 14
 package.frame.height=600
15 15
 package.frame.width=800