public LoanAccount(double balance) : base() { if (balance >= 0) { throw new InvalidOperationException("Balance should be negative when creating loan account"); } NextPaymentDate = CreatedDateTime.AddMonths(1); Balance = balance; }
public SavingsAccount(double interestInPercents, DateTime nextInterestUpdate) : base() { if (interestInPercents < 0 || interestInPercents > 100) { throw new InvalidOperationException("Interest should be number between 0 and 100"); } InterestInPercents = interestInPercents; NextInterestUpdate = CreatedDateTime.AddMonths(1); }