|
@@ -1,5 +1,3 @@
|
1
|
|
-
|
2
|
|
-
|
3
|
1
|
/**
|
4
|
2
|
* Created by leon on 2/9/18.
|
5
|
3
|
*/
|
|
@@ -9,13 +7,58 @@ public class MainApplication {
|
9
|
7
|
|
10
|
8
|
public static void main(String[] args) {
|
11
|
9
|
// Create all instances of classes to be used for this program
|
12
|
|
-
|
|
10
|
+ MainMenu mainMenu = new MainMenu();
|
|
11
|
+ SciCalc scientificCalc = new SciCalc();
|
13
|
12
|
MemoryFunc memory = new MemoryFunc();
|
14
|
13
|
SwitchDisplay baseChange = new SwitchDisplay();
|
15
|
14
|
|
|
15
|
+ // Menu Input
|
|
16
|
+ String menuInput = " ";
|
16
|
17
|
// Giant while loop that links back to main menu
|
17
|
|
- memory.memoryMenu();
|
18
|
|
-
|
|
18
|
+ while (!menuInput.equals(4)) {
|
|
19
|
+ mainMenu.mainMenuDisplay();
|
|
20
|
+ menuInput = Console.getStringInput("Enter the calculator you want to use by key. (ie. 1 for basic, etc.)");
|
|
21
|
+
|
|
22
|
+ switch (menuInput) {
|
|
23
|
+ case "1":
|
|
24
|
+
|
|
25
|
+ // Sends to basic calculator functions
|
|
26
|
+ break;
|
|
27
|
+
|
|
28
|
+ case "2":
|
|
29
|
+
|
|
30
|
+ // Sends to Advanced Calculator Functions
|
|
31
|
+ break;
|
|
32
|
+
|
|
33
|
+ case "3":
|
|
34
|
+
|
|
35
|
+ // Sends to Scientific Calculator Functions
|
|
36
|
+ // displays the menu for scientific calc
|
|
37
|
+ scientificCalc.toSciMenu();
|
|
38
|
+ String sciMenuInput = Console.getStringInput("Enter the function you'd like to use by key.");
|
|
39
|
+ // if statement to use various calc functions
|
|
40
|
+ if (sciMenuInput.equals("1")) {
|
|
41
|
+ // Base Conversions
|
|
42
|
+ baseChange.switchDisplay();
|
|
43
|
+
|
|
44
|
+ } else if (sciMenuInput.equals("2")) {
|
|
45
|
+ // Memory
|
|
46
|
+ memory.memoryMenu();
|
|
47
|
+ } else if (sciMenuInput.equals("3")) {
|
|
48
|
+ // To Trig Menu
|
|
49
|
+
|
|
50
|
+ } else {
|
|
51
|
+ break;
|
|
52
|
+ }
|
|
53
|
+ break;
|
|
54
|
+
|
|
55
|
+ case "4":
|
|
56
|
+ // Quits the calculator
|
|
57
|
+ break;
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ }
|
|
61
|
+
|
19
|
62
|
Console.println("Welcome to my calculator!");
|
20
|
63
|
/** String s = Console.getStringInput("Enter a string");
|
21
|
64
|
Integer i = Console.getIntegerInput("Enter an integer");
|
|
@@ -25,9 +68,6 @@ public class MainApplication {
|
25
|
68
|
Console.println("The user input %s as a integer", i);
|
26
|
69
|
Console.println("The user input %s as a d", d);
|
27
|
70
|
*/
|
28
|
|
-
|
29
|
|
-
|
30
|
|
-
|
31
|
71
|
|
32
|
72
|
}
|
33
|
73
|
}
|