Example #1
0
        private static void Calculate()
        {
            Console.WriteLine("Enter expression to calculate:");
            string input = Console.ReadLine();

            List <string> convertFromInfixToPostfix = ShuntingYard.Convert(input);

            Console.WriteLine("\nExpression in postfix: {0}", string.Join(" ", convertFromInfixToPostfix));

            double result = RpnAlgorithm.Calculate(convertFromInfixToPostfix);

            Console.WriteLine("\nResult = {0}", result);
        }