Ejemplo n.º 1
0
        public void Run()
        {
            while (true)
            {
                string command = InputService.ReadCommand();
                try
                {
                    CommandTypes commandType = ParsingService.ParseCommand(command);

                    Arguments args = InputService.ReadArguments();
                    OutputService.WriteMessage(
                        Calculator.Execute(commandType, args).ToString());
                }
                catch (Exception)
                {
                    OutputService.WriteMessage("Mistake!");
                }
            }
        }