Esempio n. 1
0
        public static void Main()
        {
            BankAccount bernard = new BankAccount();

            bernard.Populate(100);

            BankAccount catalina = new BankAccount();

            catalina.Populate(100);

            Console.WriteLine("Before transfer: ");
            Console.WriteLine("{0} {1} {2}", bernard.Type(), bernard.Number(), bernard.Balance());
            Console.WriteLine("{0} {1} {2}", catalina.Type(), catalina.Number(), catalina.Balance());

            bernard.TransferFrom(catalina, 10);
            Console.WriteLine("{0} {1} {2}", bernard.Type(), bernard.Number(), bernard.Balance());
            Console.WriteLine("{0} {1} {2}", catalina.Type(), catalina.Number(), catalina.Balance());
        }
        static void Main()
        {
            BankAccount b1 = new BankAccount();

            b1.Populate(100);
            BankAccount b2 = new BankAccount();

            b2.Populate(100);

            Console.WriteLine("Before transfer");
            Console.WriteLine("{0} {1} {2}", b1.Type(), b1.Number(), b1.Balance());
            Console.WriteLine("{0} {1} {2}", b2.Type(), b2.Number(), b2.Balance());

            b1.TransferFrom(b2, 10);

            Console.WriteLine("After transfer");
            Console.WriteLine("{0} {1} {2}", b1.Type(), b1.Number(), b1.Balance());
            Console.WriteLine("{0} {1} {2}", b2.Type(), b2.Number(), b2.Balance());
        }