Bladeren bron

{added divide function}

Christian Sheridan 6 jaren geleden
bovenliggende
commit
db7777d162
4 gewijzigde bestanden met toevoegingen van 28 en 1 verwijderingen
  1. BIN
      Operations.class
  2. 15
    0
      Operations.ctxt
  3. 11
    1
      Operations.java
  4. 2
    0
      OperationsTest.java

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\ divide(int,\ int)
8
+comment2.text=\n\ The\ Division\ fucntion\n
9
+comment3.params=x\ y
10
+comment3.target=int\ subtract(int,\ int)
11
+comment3.text=\n\ The\ subtraction\ function\n\ @param\ x\ The\ first\ operand\n\ @param\ y\ The\ second\ operand\n\ @return\ y\ taken\ from\ x\n
12
+comment4.params=x\ y
13
+comment4.target=int\ multiply(int,\ int)
14
+comment4.text=\n\ The\ multiplication\ function\n\ @param\ x\ The\ first\ operand\n\ @param\ y\ The\ second\ operand\n\ @return\ x\ times\ y\n
15
+numComments=5

+ 11
- 1
Operations.java Bestand weergeven

@@ -1,3 +1,5 @@
1
+package Calcul8r;
2
+
1 3
 public class Operations {
2 4
 
3 5
     /**
@@ -9,7 +11,14 @@ public class Operations {
9 11
     public static int add(int x, int y) {
10 12
         return x + y;
11 13
     }
12
-
14
+    
15
+    /**
16
+     * The Division fucntion
17
+     */
18
+    public static int divide(int x, int y) {
19
+        return x / y;
20
+    }
21
+    
13 22
     /**
14 23
      * The subtraction function
15 24
      * @param x The first operand
@@ -30,4 +39,5 @@ public class Operations {
30 39
     public static int multiply(int x, int y) {
31 40
         return x * y;
32 41
     }
42
+    
33 43
 }

+ 2
- 0
OperationsTest.java Bestand weergeven

@@ -1,3 +1,5 @@
1
+package Calcul8r;
2
+
1 3
 import org.junit.Test;
2 4
 import org.junit.Assert;
3 5