Bladeren bron

These changes have added the divide function

Steffon Williams 6 jaren geleden
bovenliggende
commit
76da8f7e90
7 gewijzigde bestanden met toevoegingen van 10001 en 6 verwijderingen
  1. 9961
    0
      Git.webarchive
  2. BIN
      Operations.class
  3. 15
    0
      Operations.ctxt
  4. 10
    0
      Operations.java
  5. BIN
      OperationsTest.class
  6. 9
    0
      OperationsTest.ctxt
  7. 6
    6
      package.bluej

+ 9961
- 0
Git.webarchive
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


BIN
Operations.class Bestand weergeven


+ 15
- 0
Operations.ctxt Bestand weergeven

@@ -0,0 +1,15 @@
1
+#BlueJ class context
2
+comment0.target=Operations
3
+comment1.params=x\ y
4
+comment1.target=int\ add(int,\ int)
5
+comment1.text=\n\ The\ addition\ function.\n\ @param\ x\ The\ first\ operand\n\ @param\ y\ The\ second\ operand\n\ @return\ the\ sum\ of\ x\ and\ y\n
6
+comment2.params=x\ y
7
+comment2.target=int\ subtract(int,\ int)
8
+comment2.text=\n\ The\ subtraction\ function\n\ @param\ x\ The\ first\ operand\n\ @param\ y\ The\ second\ operand\n\ @return\ y\ taken\ from\ x\n
9
+comment3.params=x\ y
10
+comment3.target=int\ multiply(int,\ int)
11
+comment3.text=\n\ The\ multiplication\ function\n\ @param\ x\ The\ first\ operand\n\ @param\ y\ The\ second\ operand\n\ @return\ x\ times\ y\n
12
+comment4.params=x\ y
13
+comment4.target=int\ divide(int,\ int)
14
+comment4.text=\n\ The\ divide\ function\n\ @param\ x\ The\ first\ operand\ \n\ @param\ y\ The\ second\ operand\n\ @return\ x\ divided\ by\ y\n
15
+numComments=5

+ 10
- 0
Operations.java Bestand weergeven

@@ -30,4 +30,14 @@ public class Operations {
30 30
     public static int multiply(int x, int y) {
31 31
         return x * y;
32 32
     }
33
+    
34
+    /**
35
+     * The divide function
36
+     * @param x The first operand 
37
+     * @param y The second operand
38
+     * @return x divided by y
39
+     */
40
+    public static int divide(int x, int y) {
41
+        return x / y;
42
+    }
33 43
 }

BIN
OperationsTest.class Bestand weergeven


+ 9
- 0
OperationsTest.ctxt Bestand weergeven

@@ -0,0 +1,9 @@
1
+#BlueJ class context
2
+comment0.target=OperationsTest
3
+comment1.params=
4
+comment1.target=void\ testAdd()
5
+comment2.params=
6
+comment2.target=void\ testSubtract()
7
+comment3.params=
8
+comment3.target=void\ testMultiply()
9
+numComments=4

+ 6
- 6
package.bluej Bestand weergeven

@@ -2,18 +2,18 @@
2 2
 dependency1.from=OperationsTest
3 3
 dependency1.to=Operations
4 4
 dependency1.type=UsesDependency
5
-editor.fx.0.height=722
6
-editor.fx.0.width=800
7
-editor.fx.0.x=320
8
-editor.fx.0.y=75
5
+editor.fx.0.height=1080
6
+editor.fx.0.width=958
7
+editor.fx.0.x=1440
8
+editor.fx.0.y=0
9 9
 objectbench.height=164
10 10
 objectbench.width=776
11 11
 package.divider.horizontal=0.6
12 12
 package.divider.vertical=0.6845018450184502
13 13
 package.editor.height=364
14 14
 package.editor.width=674
15
-package.editor.x=-1455
16
-package.editor.y=82
15
+package.editor.x=177
16
+package.editor.y=23
17 17
 package.frame.height=600
18 18
 package.frame.width=800
19 19
 package.numDependencies=1