コード例 #1
0
 public void TransferTo(double amount, AccountS another)
 {
     if (Withdraw(amount))
     {
         another.Deposit(amount);
     }
 }
コード例 #2
0
        public static void Main()
        {
            CustomerS cus1 = new CustomerS("Tan Ah Kow", "2 Rich Street",
                                           "P123123", 20);
            CustomerS cus2 = new CustomerS("Kim May Mee", "89 Gold Road",
                                           "P334412", 60);

            AccountS a1 = new AccountS("S0000223", cus1, 2000);
            //Console.WriteLine(a1.CalculateInterest());
            OverdraftAccountS a2 = new OverdraftAccountS("O1230124", cus1, 2000);
            //Console.WriteLine(a2.CalculateInterest());
            CurrentAccountS a3 = new CurrentAccountS("C1230125", cus2, 2000);

            //Console.WriteLine(a3.CalculateInterest());

            //AccountS a4 = new CurrentAccountS("F7467228", cus2, 2000);
            //Console.WriteLine(a4.CalculateInterest());


            Console.WriteLine(a2.Show());
            Console.WriteLine(a2.CalculateInterest());
            a2.CreditInterest();
            Console.WriteLine(a2.Show());
        }