public override void MakeWithdrawal(double amount) { if(amount > 0) { if(AccountBalance + OverdraftLimit > amount) { AccountBalance = (amount * -1); AccountTransaction transact = new AccountTransaction(TransactionType.Withdrawal, amount); transactionHistory.Add(transact); } else { throw new ArgumentException("Overdraft limit reached"); } } else { throw new ArgumentException("cannot be a negative number"); } }
public override void MakeDeposit(double amount) { if(amount > 0) { AccountBalance = amount; AccountTransaction transact = new AccountTransaction(TransactionType.Deposit, amount); transactionHistory.Add(transact); } else{ throw new ArgumentException("Cannot be a negative value"); } }