Explorar el Código

Alice and Bob complete - Demetrius

Demetrius Murray hace 6 años
padre
commit
00f069d65a
Se han modificado 7 ficheros con 57 adiciones y 11 borrados
  1. BIN
      Main.class
  2. 6
    0
      Main.ctxt
  3. 5
    3
      Main.java
  4. BIN
      Name.class
  5. 5
    0
      Name.ctxt
  6. 23
    0
      Name.java
  7. 18
    8
      package.bluej

BIN
Main.class Ver fichero


+ 6
- 0
Main.ctxt Ver fichero

@@ -0,0 +1,6 @@
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
+numComments=2

+ 5
- 3
Main.java Ver fichero

@@ -1,9 +1,11 @@
1 1
 /**
2 2
  * Created by iyasuwatts on 10/17/17.
3 3
  */
4
-public class Main {
5
-
6
-    public static void main(String[] args ){
7 4
 
5
+public class Main {
6
+    public static void main(String[] args){
7
+        Name name = new Name();
8
+        name.enterName();
8 9
     }
9 10
 }
11
+

BIN
Name.class Ver fichero


+ 5
- 0
Name.ctxt Ver fichero

@@ -0,0 +1,5 @@
1
+#BlueJ class context
2
+comment0.target=Name
3
+comment1.params=
4
+comment1.target=void\ enterName()
5
+numComments=2

+ 23
- 0
Name.java Ver fichero

@@ -0,0 +1,23 @@
1
+
2
+/**
3
+ * Write a description of class Name here.
4
+ *
5
+ * @author (your name)
6
+ * @version (a version number or a date)
7
+ */
8
+import java.util.Scanner;
9
+
10
+public class Name
11
+{
12
+    public void enterName(){
13
+        Scanner s = new Scanner(System.in);
14
+        System.out.println("What's your name?");
15
+        String name = s.nextLine();
16
+        
17
+        if(name.equals("Bob") || name.equals("Alice")){
18
+            System.out.println("What's up, " + name + "!");
19
+        } else {
20
+            System.out.println("Please leave");
21
+        }
22
+    }
23
+}

+ 18
- 8
package.bluej Ver fichero

@@ -1,20 +1,23 @@
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
+dependency1.from=Main
3
+dependency1.to=Name
4
+dependency1.type=UsesDependency
5
+editor.fx.0.height=717
6
+editor.fx.0.width=800
7
+editor.fx.0.x=480
8
+editor.fx.0.y=30
6 9
 objectbench.height=101
7 10
 objectbench.width=776
8 11
 package.divider.horizontal=0.6
9 12
 package.divider.vertical=0.8007380073800738
10 13
 package.editor.height=427
11 14
 package.editor.width=674
12
-package.editor.x=181
13
-package.editor.y=109
15
+package.editor.x=100
16
+package.editor.y=100
14 17
 package.frame.height=600
15 18
 package.frame.width=800
16
-package.numDependencies=0
17
-package.numTargets=1
19
+package.numDependencies=1
20
+package.numTargets=2
18 21
 package.showExtends=true
19 22
 package.showUses=true
20 23
 project.charset=UTF-8
@@ -30,3 +33,10 @@ target1.type=ClassTarget
30 33
 target1.width=80
31 34
 target1.x=70
32 35
 target1.y=10
36
+target2.height=50
37
+target2.name=Name
38
+target2.showInterface=false
39
+target2.type=ClassTarget
40
+target2.width=80
41
+target2.x=160
42
+target2.y=10