|
@@ -32,6 +32,7 @@ public class Console {
|
32
|
32
|
menuInput = Console.getStringInput("Enter the calculator you want to use by key. (ie. 1 for basic, etc.)");
|
33
|
33
|
|
34
|
34
|
switch (menuInput) {
|
|
35
|
+ // Basic Calculator
|
35
|
36
|
case "1":
|
36
|
37
|
basicCalc.Basic();
|
37
|
38
|
|
|
@@ -62,9 +63,9 @@ public class Console {
|
62
|
63
|
basicCalc.getQuotient(basicInput1, basicInput2);
|
63
|
64
|
}
|
64
|
65
|
} else if (basicMode.equals("5")) {
|
65
|
|
-
|
|
66
|
+
|
66
|
67
|
break;
|
67
|
|
-
|
|
68
|
+
|
68
|
69
|
} else {
|
69
|
70
|
//error if wrong input was entered
|
70
|
71
|
answer = Double.NaN;
|
|
@@ -103,11 +104,50 @@ public class Console {
|
103
|
104
|
memory.memoryMenu();
|
104
|
105
|
} else if (sciMenuInput.equals("3")) {
|
105
|
106
|
// To Trig Menu
|
106
|
|
- answer = trigMenu.TrigFunctions();
|
107
|
|
- Console.println(Double.toString(answer));
|
108
|
|
- String response = Console.getStringInput("Would you like to convert your answer from radian to degrees? Y or N").toLowerCase();
|
|
107
|
+ trigMenu.trigFunctions();
|
|
108
|
+ String mode = Console.getStringInput("Enter trignometric function by key: (ie. 1 for sin)");
|
|
109
|
+
|
|
110
|
+ double trigInput = Console.getDoubleInput("Enter the input for the trignometric function: ");
|
|
111
|
+
|
|
112
|
+ if (mode.equals("1")) {
|
|
113
|
+ answer = trigMenu.calcSin(trigInput);
|
|
114
|
+
|
|
115
|
+ //COS
|
|
116
|
+ } else if (mode.equals("2")) {
|
|
117
|
+ answer = trigMenu.calcCos(trigInput);
|
|
118
|
+
|
|
119
|
+ //TAN
|
|
120
|
+ } else if (mode.equals("3")) {
|
|
121
|
+ answer = trigMenu.calcTan(trigInput);
|
|
122
|
+
|
|
123
|
+ //ARCSIN
|
|
124
|
+ } else if (mode.equals("4")) {
|
|
125
|
+ answer = trigMenu.calcArcsin(trigInput);
|
|
126
|
+
|
|
127
|
+ //ARCCOS
|
|
128
|
+ } else if (mode.equals("5")) {
|
|
129
|
+ answer = trigMenu.calcArccos(trigInput);
|
|
130
|
+
|
|
131
|
+ //ARCTAN
|
|
132
|
+ } else if (mode.equals("6")) {
|
|
133
|
+ answer = trigMenu.calcArctan(trigInput);
|
|
134
|
+
|
|
135
|
+ } else if (mode.equals("7")) {
|
|
136
|
+ break;
|
|
137
|
+
|
|
138
|
+ } else {
|
|
139
|
+ //Error message if input does not match options, loops back to the top so they can try again.
|
|
140
|
+ answer = Double.NaN;
|
|
141
|
+
|
|
142
|
+ }
|
|
143
|
+
|
|
144
|
+ String trigAnswer = Double.toString(answer);
|
|
145
|
+ Console.println(trigAnswer);
|
|
146
|
+
|
|
147
|
+ String trigDefRad = Console.getStringInput("Do you want to convert your answer from radians to degrees?"
|
|
148
|
+ + "\nEnter Y or N").toLowerCase();
|
109
|
149
|
|
110
|
|
- if (response.equals("y") ) {
|
|
150
|
+ if (trigDefRad.equals("y") ) {
|
111
|
151
|
trigMenu.toDegrees(answer);
|
112
|
152
|
}
|
113
|
153
|
break;
|