Beispiel #1
0
        public void StateStatus(List <State> states)
        {
            Console.WriteLine();

            if (amount < Engine.GetPrice())
            {
                Console.WriteLine("Not enough money to buy the product");
            }
            else if (amount == Engine.GetPrice())
            {
                Console.WriteLine("Merchandise dispensed");

                currenntState = FindStateByAmount(Engine.GetStates(), 0);
            }
            else
            {
                Console.WriteLine($"Merchandise dispensed and {currenntState.amount - Engine.GetPrice()} was returned in change");

                currenntState = FindStateByAmount(Engine.GetStates(), 0);
            }
        }