private void AppendEquation(string key, string arg) { var eq = new Equation(arg, this); var reversePolishNotation = new ReversePolishNotation(this); var result = reversePolishNotation.CalculateEquation(eq); this.Cells.Add(key, result); }
private void ExpressionCalculation(string line) { try { var eq = new Equation(line, _spreadSheet); var reversePolishNotation = new ReversePolishNotation(_spreadSheet); var result = reversePolishNotation.CalculateEquation(eq); Console.WriteLine($"\tResult of {line}={result}"); } catch (ValidationException ex) { Console.WriteLine(ex.Message); } }