|
@@ -10,55 +10,19 @@
|
10
|
10
|
*/
|
11
|
11
|
public class SciCalc
|
12
|
12
|
{
|
13
|
|
-
|
14
|
|
- private double memory = 0;
|
15
|
|
-
|
16
|
|
- /**
|
17
|
|
- * Switch Display Mode method
|
18
|
|
- * -> binary, octal, decimal, hexadecimal
|
19
|
|
- * switchDisplayMode() rotates through the options
|
20
|
|
- * switchDisplayMode(String mode) sets the display to the mode given
|
21
|
|
- */
|
22
|
|
- public void switchDisplay(String mode)
|
23
|
|
- {
|
24
|
|
- int baseInput = Console.getIntegerInput("Enter an integer to see the base conversions.");
|
25
|
|
-
|
26
|
|
- Console.println("Display Options"
|
27
|
|
- + "\nBinary: " + null
|
28
|
|
- + "\nOctal: " + null
|
29
|
|
- + "\nDecimal: " + null
|
30
|
|
- + "\nHexadecimal: " + null
|
31
|
|
- + "\n");
|
32
|
|
-
|
33
|
|
- mode = Console.getStringInput("Enter the base option to display.");
|
34
|
|
- if (mode.toLowerCase().equals("binary") == true) {
|
35
|
|
-
|
36
|
|
- } else if (mode.toLowerCase().equals("octal") == true) {
|
37
|
|
-
|
38
|
|
- }
|
39
|
|
-
|
40
|
|
-
|
41
|
|
- }
|
42
|
|
-
|
43
|
|
- /**
|
44
|
|
- * Converts the user input into octal and returns a string of that octal.
|
45
|
|
- */
|
46
|
|
- public String toOctal(int userInput) {
|
47
|
|
-
|
48
|
|
- return Integer.toOctalString(userInput);
|
49
|
|
-
|
|
13
|
+ public void toSwitchDisplay() {
|
|
14
|
+ SwitchDisplay switchDisplayMenu = new SwitchDisplay();
|
50
|
15
|
}
|
51
|
16
|
|
52
|
17
|
public void toMemory() {
|
53
|
18
|
MemoryFunc memoryMenu = new MemoryFunc();
|
54
|
19
|
}
|
55
|
20
|
|
56
|
|
-
|
57
|
21
|
/**
|
58
|
22
|
* To Trig -
|
59
|
23
|
* sends user to trig functions of the calculator
|
60
|
24
|
*/
|
61
|
|
- public void toTrig(int y)
|
|
25
|
+ public void toTrig(int y)
|
62
|
26
|
{
|
63
|
27
|
// calls the trig menu
|
64
|
28
|
Trig trigMenu = new Trig();
|