Exemple #1
0
 public override void MakeWithdrawal(double amount)
 {
     if (amount > 0)
     {
         if (amount > (Balance + overdraft))
         {
             throw new ApplicationException("Insufficient Funds");
         }
         else
         {
             Balance = Balance - amount;
             transactionHistory[numTransactions++]
                 = new AccountTransaction(TransactionType.Withdrawal, amount);
         }
     }
     else
     {
         throw new ArgumentException("Amount must be greater than 0");
     }
 }
Exemple #2
0
 public override void MakeDeposit(double amount)
 {
     Balance += amount;
     transactionHistory[numTransactions++]
         = new AccountTransaction(TransactionType.Deposit, amount);
 }