12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /**
- * Created by leon on 2/9/18.
- */
- import java.util.*;
-
- public class MainApplication {
-
- public static void main(String[] args) {
- // Create all instances of classes to be used for this program
- MainMenu mainMenu = new MainMenu();
- SciCalc scientificCalc = new SciCalc();
- MemoryFunc memory = new MemoryFunc();
- SwitchDisplay baseChange = new SwitchDisplay();
-
- // Stored memory value should be able to be used throughout whole application
- Double memoryValue = memory.memory;
-
- // if any input = "m", that input now = the memory value
-
- // Menu Input
- String menuInput = " ";
- // Giant while loop that links back to main menu
- while (!menuInput.equals("4")) {
- mainMenu.mainMenuDisplay();
- menuInput = Console.getStringInput("Enter the calculator you want to use by key. (ie. 1 for basic, etc.)");
-
- switch (menuInput) {
- case "1":
-
- // Sends to basic calculator functions
- break;
-
- case "2":
-
- // Sends to Advanced Calculator Functions
- break;
-
- case "3":
-
- // Sends to Scientific Calculator Functions
- // displays the menu for scientific calc
- scientificCalc.toSciMenu();
- String sciMenuInput = Console.getStringInput("Enter the function you'd like to use by key.");
- // if statement to use various calc functions
- if (sciMenuInput.equals("1")) {
- // Base Conversions
- baseChange.switchDisplay();
-
- } else if (sciMenuInput.equals("2")) {
- // Memory
- memory.memoryMenu();
- } else if (sciMenuInput.equals("3")) {
- // To Trig Menu
-
- } else {
- break;
- }
- break;
-
- case "4":
- // Quits the calculator
- break;
- }
-
- }
-
- Console.println("Welcome to my calculator!");
- /** String s = Console.getStringInput("Enter a string");
- Integer i = Console.getIntegerInput("Enter an integer");
- Double d = Console.getDoubleInput("Enter a double.");
-
- Console.println("The user input %s as a string", s);
- Console.println("The user input %s as a integer", i);
- Console.println("The user input %s as a d", d);
- */
-
- }
- }
|