|
@@ -8,71 +8,73 @@
|
8
|
8
|
import java.util.*;
|
9
|
9
|
public class simpleOp
|
10
|
10
|
{
|
|
11
|
+ public static int currentNumber = 0;
|
|
12
|
+
|
11
|
13
|
public static int add(int x, int y){
|
12
|
14
|
//CALULATES THE SUM OF TWO NUMBERS
|
13
|
|
- int z = x + y;
|
14
|
|
- System.out.println(x + " + " + y + " = " + z);
|
15
|
|
- return z;
|
|
15
|
+ currentNumber = x + y;
|
|
16
|
+ System.out.println(currentNumber);
|
|
17
|
+ return currentNumber;
|
16
|
18
|
}
|
17
|
19
|
|
18
|
20
|
public static int sub(int x, int y){
|
19
|
21
|
//CALULATES THE DIFFERENCE OF TWO NUMBERS
|
20
|
|
- int z = x - y;
|
21
|
|
- System.out.println(x + " - " + y + " = " + z);
|
22
|
|
- return z;
|
|
22
|
+ int currentNumber = x - y;
|
|
23
|
+ System.out.println(x + " - " + y + " = " + currentNumber);
|
|
24
|
+ return currentNumber;
|
23
|
25
|
}
|
24
|
26
|
|
25
|
27
|
public static int mul(int x, int y){
|
26
|
28
|
//CALULATES THE PRODUCT OF TWO NUMBERS
|
27
|
|
- int z = x * y;
|
28
|
|
- System.out.println(x + " * " + y + " = " + z);
|
29
|
|
- return z;
|
|
29
|
+ int currentNumber = x * y;
|
|
30
|
+ System.out.println(x + " * " + y + " = " + currentNumber);
|
|
31
|
+ return currentNumber;
|
30
|
32
|
}
|
31
|
33
|
|
32
|
34
|
public static int div(int x, int y){
|
33
|
35
|
//CALULATES THE QUOTIENT OF TWO NUMBERS
|
34
|
|
- int z = x / y;
|
35
|
|
- System.out.println(x + " / " + y + " = " + z);
|
36
|
|
- return z;
|
|
36
|
+ int currentNumber = x / y;
|
|
37
|
+ System.out.println(x + " / " + y + " = " + currentNumber);
|
|
38
|
+ return currentNumber;
|
37
|
39
|
}
|
38
|
40
|
|
39
|
41
|
public static int squ(int x){
|
40
|
42
|
//CALULATES THE SQUARE OF ONE NUMBER
|
41
|
43
|
//CASTED TO INT FOR NOW... IT'S IN ALPHA, YOU DIG?
|
42
|
|
- int z = (int) Math.pow(x,2);
|
43
|
|
- System.out.println(x + "\u00B2 = " + z);
|
44
|
|
- return z;
|
|
44
|
+ int currentNumber = (int) Math.pow(x,2);
|
|
45
|
+ System.out.println(x + "\u00B2 = " + currentNumber);
|
|
46
|
+ return currentNumber;
|
45
|
47
|
}
|
46
|
48
|
|
47
|
49
|
public static int sqrt(int x){
|
48
|
50
|
//CALULATES THE SQUARE ROOT OF ONE NUMBER
|
49
|
51
|
//CASTED TO INT FOR NOW... IT'S IN ALPHA, YOU DIG?
|
50
|
|
- int z = (int) Math.sqrt(x);
|
51
|
|
- System.out.println("√" + x + " = " + z);
|
52
|
|
- return z;
|
|
52
|
+ int currentNumber = (int) Math.sqrt(x);
|
|
53
|
+ System.out.println("√" + x + " = " + currentNumber);
|
|
54
|
+ return currentNumber;
|
53
|
55
|
}
|
54
|
56
|
|
55
|
57
|
public static int exp(int x, int y){
|
56
|
58
|
//CALULATES EXPONENTIATION OF X TO POWER OF Y
|
57
|
59
|
//CASTED TO INT FOR NOW... IT'S IN ALPHA, YOU DIG?
|
58
|
|
- int z = (int) Math.pow(x,y);
|
59
|
|
- System.out.println(x + "^" + y + " = " + z);
|
60
|
|
- return z;
|
|
60
|
+ int currentNumber = (int) Math.pow(x,y);
|
|
61
|
+ System.out.println(x + "^" + y + " = " + currentNumber);
|
|
62
|
+ return currentNumber;
|
61
|
63
|
}
|
62
|
64
|
|
63
|
65
|
public static double inv(double x){
|
64
|
66
|
//CALULATES THE INVERSE OF NUMBER
|
65
|
67
|
//CASTED TO INT FOR NOW... IT'S IN ALPHA, YOU DIG?
|
66
|
|
- double z = 1 / x;
|
67
|
|
- System.out.println("1 / " + x + " = " + z);
|
68
|
|
- return z;
|
|
68
|
+ double currentNumber = 1 / x;
|
|
69
|
+ System.out.println("1 / " + x + " = " + currentNumber);
|
|
70
|
+ return currentNumber;
|
69
|
71
|
}
|
70
|
72
|
|
71
|
73
|
public static int invert(int number){
|
72
|
74
|
//TURNS NEGATIVE TO POSITIVE OR POSITIVE TO NEGATIVE
|
73
|
|
- int invertedNumber = -number;
|
74
|
|
- System.out.println(invertedNumber);
|
75
|
|
- return invertedNumber;
|
|
75
|
+ currentNumber = -number;
|
|
76
|
+ System.out.println(currentNumber);
|
|
77
|
+ return currentNumber;
|
76
|
78
|
}
|
77
|
79
|
|
78
|
80
|
}
|