// Evaluates the operator, calls the right math method, prints answer, and passes answer to it's recall method
 public void Calculate(string Operator, string UserInput)
 {
     if (Operator == "+")  // Addition
     {
         Answer = Calculator.Add(First, Second);
         Console.WriteLine("Answer:  " + Answer);
         Stack.LastAnswer(UserInput, Answer);
     }
     else if (Operator == "-")  // Subtraction
     {
         Answer = Calculator.Subtract(First, Second);
         Console.WriteLine("Answer:  " + Answer);
         Stack.LastAnswer(UserInput, Answer);
     }
     else if (Operator == "*")  // Multiplication
     {
         Answer = Calculator.Multiply(First, Second);
         Console.WriteLine("Answer:  " + Answer);
         Stack.LastAnswer(UserInput, Answer);
     }
     else if (Operator == "/") // Division
     {
         if (Second == 0)      // Throws error message if trying to divide by zero
         {
             Console.WriteLine("You can't divide by zero, Holmes.");
         }
         else
         {
             Answer = Calculator.Divide(First, Second);
             Console.WriteLine("Answer:  " + Answer);
             Stack.LastAnswer(UserInput, Answer);
         }
     }
     else if (Operator == "%")  // Modulus Function
     {
         Answer = Calculator.Modulus(First, Second);
         Console.WriteLine("Answer:  " + Answer);
         Stack.LastAnswer(UserInput, Answer);
     }
 }
        static void Main(string[] args)
        {
            int          counter   = 1;
            StackStorage mathStack = new StackStorage();

            while (true)
            {
                Console.Write($"[{counter}]> ");

                string Command = Console.ReadLine();

                if (Command.ToLower() == "quit" || Command.ToLower() == "exit")
                {
                    Environment.Exit(0);
                }
                else if (Command == "last")
                {
                    Command = mathStack.getLastProblem();
                }
                else if (Command == "lastq")
                {
                    Console.WriteLine("last problem was " + mathStack.getLastProblem());
                }

                //initalize regex expression
                Expression expression = new Expression();
                expression.VerifyExpression(Command);
                int    firstNum  = expression.FirstNum;
                int    secondNum = expression.SecondNum;
                string Operator  = expression.Operator;

                string userMathExpression = (firstNum + Operator + secondNum).ToString();

                //adds the user input into addMathToStack and makes it a string
                mathStack.addMathToStack(userMathExpression);

                //switch statement for calculations
                switch (Operator)
                {
                case "+":
                    Calculator calcAdd = new Calculator();
                    Console.WriteLine("   = " + calcAdd.Add(firstNum, secondNum));
                    break;

                case "-":
                    Calculator calcSubtract = new Calculator();
                    Console.WriteLine("   = " + calcSubtract.Subtract(firstNum, secondNum));
                    break;

                case "*":
                    Calculator calcMultiply = new Calculator();
                    Console.WriteLine("   = " + calcMultiply.Multiply(firstNum, secondNum));
                    break;

                case "/":
                    Calculator calcDivide = new Calculator();
                    Console.WriteLine("   = " + calcDivide.Divide(firstNum, secondNum));
                    break;

                case "%":
                    Calculator calcModulus = new Calculator();
                    Console.WriteLine("   = " + calcModulus.Modulus(firstNum, secondNum));
                    break;

                default:
                    break;
                }
                counter++;
            }
        }