Пример #1
0
 public PrincipalInterestBalance Add(PrincipalInterestBalance other)
 {
     return(new PrincipalInterestBalance
     {
         Interest = this.Interest + other.Interest,
         Principal = this.Principal + other.Principal
     });
 }
Пример #2
0
 public CreditCard(string name, double startingBalance, double ratePerPeriod, IDiscreteInterestCalculator interestCalculator)
 {
     Name = name;
     _principalInterestBalance = new PrincipalInterestBalance {
         Principal = startingBalance, Interest = 0
     };
     _rate = ratePerPeriod;
     _interestCalculator = interestCalculator;
 }
Пример #3
0
 public void PassTime(int periods)
 {
     _principalInterestBalance += _interestCalculator.CalculateInterest(Principal, _rate, periods);
 }