Пример #1
0
        static void Main(string[] args)
        {
            ATMInterface realATM = new RealATM("Piet");

            realATM.WithdrawMoney();

            Console.WriteLine();

            ATMInterface proxyATM = new ProxyATM("Klaas");

            proxyATM.WithdrawMoney();

            Console.ReadLine();
        }
        public void WithdrawMoney()
        {
            Console.WriteLine("Please enter your PIN.");
            string pin = Console.ReadLine();

            if (pin == pincode)
            {
                Console.WriteLine("Your PIN is correct.");

                RealATM realATM = new RealATM(name);
                realATM.WithdrawMoney();
            }
            else
            {
                Console.WriteLine("Your PIN is incorrect.");
            }
        }