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