Ejemplo n.º 1
0
 public void AddChild(IProfitable profitable)
 {
     if (profitable is Store)
     {
         StoreList.Add(profitable);
     }
 }
Ejemplo n.º 2
0
 public void RemoveChild(IProfitable profitable)
 {
     if (profitable is Store)
     {
         StoreList.Remove(profitable);
     }
 }
Ejemplo n.º 3
0
 public void RemoveChild(IProfitable profitable)
 {
     if (profitable is City)
     {
         CityList.Remove(profitable);
     }
 }
Ejemplo n.º 4
0
 public void AddChild(IProfitable profitable)
 {
     if (profitable is City)
     {
         CityList.Add(profitable);
     }
 }
Ejemplo n.º 5
0
 private static void PayAnnualInterest(Account[] accounts)
 {
     foreach (Account acc in accounts)
     {
         IProfitable p = acc as IProfitable;
         p?.AddInterest(1);             //if(p != null) p.AddInterest(1)
     }
 }
Ejemplo n.º 6
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);
         }
     }
 }
Ejemplo n.º 7
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);
         }
     }
 }
Ejemplo n.º 8
0
 public void RemoveChild(IProfitable profitable)
 {
     throw new NotImplementedException();
 }