|
@@ -55,16 +55,39 @@ public class Operations
|
55
|
55
|
result = ScientificFunctions.sine(firstNumber);
|
56
|
56
|
//firstNumber = result;
|
57
|
57
|
//result = firstNumber;
|
|
58
|
+ Console.printResult(result);
|
58
|
59
|
}
|
59
|
60
|
if (command.equalsIgnoreCase("cos")) {
|
60
|
61
|
// read first number
|
61
|
62
|
firstNumber = input.nextDouble();
|
62
|
|
- // call the square method on calc and display
|
|
63
|
+ // call the cosine method on calc and display
|
63
|
64
|
result = ScientificFunctions.cos(firstNumber);
|
|
65
|
+ Console.printResult(result);
|
64
|
66
|
}
|
65
|
|
- //if (command.equalsIgnoreCase("hex")) {
|
|
67
|
+ if (command.equalsIgnoreCase("tan")) {
|
66
|
68
|
// call the square method on calc and display
|
67
|
|
- //}
|
|
69
|
+ firstNumber = input.nextDouble();
|
|
70
|
+ result = ScientificFunctions.tangent(firstNumber);
|
|
71
|
+ Console.printResult(result);
|
|
72
|
+ }
|
|
73
|
+ if (command.equalsIgnoreCase("cos-1")) {
|
|
74
|
+ // call the square method on calc and display
|
|
75
|
+ firstNumber = input.nextDouble();
|
|
76
|
+ result = ScientificFunctions.inverseCosine(firstNumber);
|
|
77
|
+ Console.printResult(result);
|
|
78
|
+ }
|
|
79
|
+ if (command.equalsIgnoreCase("sin-1")) {
|
|
80
|
+ // call the square method on calc and display
|
|
81
|
+ firstNumber = input.nextDouble();
|
|
82
|
+ result = ScientificFunctions.inverseSine(firstNumber);
|
|
83
|
+ Console.printResult(result);
|
|
84
|
+ }
|
|
85
|
+ if (command.equalsIgnoreCase("tan-1")) {
|
|
86
|
+ // call the square method on calc and display
|
|
87
|
+ firstNumber = input.nextDouble();
|
|
88
|
+ result = ScientificFunctions.inverseTangent(firstNumber);
|
|
89
|
+ Console.printResult(result);
|
|
90
|
+ }
|
68
|
91
|
firstNumber = result;
|
69
|
92
|
// and on and on
|
70
|
93
|
}
|