public InterestBearingAccount(decimal initialDeposit, InterestCounpoundType compoundType = InterestCounpoundType.Daily) : base(initialDeposit) { MonetaryCycles = new CoreList <MonetaryCycle>(); this._CreateCycle(DateProvider.Now().Date); RateLimits = new List <IRateLimit>(); this.CompoundType = compoundType; this.RegisterRateProviders(); this.Transactions_OnAdd(this.Transactions[0], null); }
public CheckingAccount(decimal initialDeposit, InterestCounpoundType compoundeType = InterestCounpoundType.Daily, double defaultRate = 0.0) : base(initialDeposit) { base.DefaultInterestRate = defaultRate; base.Type = InterestAccountType.Checking; base.TypeName = "Checking Account"; }
public IInterestAccount OpenInterestAccount(InterestAccountType type, decimal initialDeposit, InterestCounpoundType compoundType = InterestCounpoundType.Daily, double defaultRate = 0.0) { ValidationHelper.NotNull(type, "type"); ValidationHelper.NegativeNumeric <decimal>(initialDeposit, "initialDeposit"); ValidationHelper.NegativeNumeric <double>(defaultRate, "defaultRate"); IInterestAccount _account = null; switch (type) { case (InterestAccountType.Checking): _account = new CheckingAccount(initialDeposit, compoundType, defaultRate); break; case (InterestAccountType.Savings): _account = new SavingsAccount(initialDeposit, compoundType, defaultRate); break; case (InterestAccountType.MaxiSavings): _account = new MaxiSavingsAccount(initialDeposit, compoundType, defaultRate); break; default: throw new Exception("Account type is not yet supported"); } this.InterestAccounts.Add(_account); return(_account); }
public SavingsAccount(decimal initialDeposit, InterestCounpoundType compoundeType = InterestCounpoundType.Daily, double defaultRate = 0.0) : base(initialDeposit, compoundeType) { base.DefaultInterestRate = defaultRate; base.Type = InterestAccountType.Savings; base.TypeName = "Savings Account"; }
public static decimal SimpleInterestCompounding(decimal principle, double annualRate, int periodCount, InterestCounpoundType compoundType) { ValidationHelper.NegativeNumeric <decimal>(principle, "principle"); ValidationHelper.NegativeNumeric <double>(annualRate, "annualRate"); ValidationHelper.NegativeNumeric <int>(periodCount, "periodCount"); decimal calculated_value = 0; switch (compoundType) { case InterestCounpoundType.Daily: calculated_value = _InterestCompoundCalculation(principle, annualRate, periodCount, 365); break; } return(calculated_value); }