예제 #1
0
 private static void PayAnnualInterest(Account[] accounts)
 {
     foreach (Account acc in accounts)
     {
         IProfitable p = acc as IProfitable;
         if (p != null)
         {
             double interest = p.GetInterest(12);
             acc.Deposit(interest);
         }
     }
 }
예제 #2
0
 private static void PayAnnualInterest(Account[] group)
 {
     foreach (var acc in group)
     {
         IProfitable p = acc as IProfitable;
         if (p != null)
         {
             double i = p.GetInterest(1);
             acc.Deposit(i);
         }
     }
 }