Example #1
0
        public static void Main(string[] args)
        {
            Account a = new Account("001-001-001", "Tan Ah Kow", 2000);
            Account b = new Account("001-001-002", "Kim Keng Lee", 5000);

            Console.WriteLine(a.Show());
            Console.WriteLine(b.Show());

            a.Deposit(100);
            Console.WriteLine(a.Show());

            a.Withdraw(200);
            Console.WriteLine(a.Show());

            a.TransferTo(300, b);
            Console.WriteLine(a.Show());
            Console.WriteLine(b.Show());
        }
Example #2
0
 public void TransferTo(double amount, Account another)
 {
     balance = balance - amount;
     another.Deposit(amount);
 }