Ejemplo n.º 1
0
        static void methodCoinDenom(Vend vend)
        {
            Console.WriteLine("Please insert a coin:");
            string coinDenom    = Console.ReadLine();
            bool   isDoubleCoin = double.TryParse(coinDenom, out double coinDenomResult);

            if (isDoubleCoin)
            {
                vend.CoinInsert(coinDenomResult);
            }
            else
            {
                Console.WriteLine("Please enter a valid coin");
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Vend select1 = new Vend();

            while (true)
            {
                Console.WriteLine("Type \n 'I' to Insert Coin \n 'R' to Refund \n 'O' to Order Item \n 'E' to Exit");
                string option = Console.ReadLine();
                if (option.ToUpper() == "I")
                {
                    methodCoinDenom(select1);
                }
                else if (option.ToUpper() == "R")
                {
                    methodRefund(select1);
                    break;
                }
                else if (option.ToUpper() == "O")
                {
                    methodOrder(select1);
                    {
                        methodNewBalance(select1);
                    }
                }
                else if (option.ToUpper() == "E")
                {
                    methodRefund(select1);
                    break;

                    // Console.WriteLine("Thank you for your business!");
                }
                else
                {
                    Console.WriteLine("Please input a valid option");
                }
            }
            Console.ReadLine();
        }
Ejemplo n.º 3
0
 static void methodOrder(Vend order)
 {
     order.OrderItem("");
 }
Ejemplo n.º 4
0
 static void methodRefund(Vend change)
 {
     change.GiveRefund();
 }
Ejemplo n.º 5
0
 static void methodNewBalance(Vend balance)
 {
     balance.KeepBalance(0.00);
 }