Exemplo n.º 1
0
        public void StartUp()
        {
            try
            {
                while (true)
                {
                    _reusableMethods = new ReusableMethods();
                    _fibonacciMenu   = new FibonacciMenu(_reusableMethods);
                    _input           = _fibonacciMenu.InputMenu();

                    if (int.TryParse(_input, out _value))
                    {
                        _outPutFunctionality = new FibonacciOutput(new FibonacciCalculation());
                        _outPutFunctionality.Output(_input);
                        Console.Clear();
                    }
                    else if (_input.ToLower() == "clear")
                    {
                        Console.Clear();
                    }
                    else if (_input.ToLower() == "quit")
                    {
                        break;
                    }
                    else
                    {
                        Console.Clear();
                        Console.WriteLine("Incorrect value please enter one of the following:");
                    }
                }
            }
            catch (Exception ex)
            {
                _reusableMethods.LogError(ex);
                throw new FibonacciException("Fibonacci Calculation Failed", ex);
            }
        }
Exemplo n.º 2
0
 public FibonacciStartUp()
 {
     _outPutFunctionality = new FibonacciOutput(new FibonacciCalculation());
 }