package com.k3nx.mybank;

import android.util.Log;

/**
 * Created by Ken Wilcox on 1/9/2015 2:55 PM.
 *
 */
public class BankAccount {

    private static final String TAG = "BankAccount";

    private double mBalance;
    public final static double OVERDRAFT_FEE = 30;

    public void withdraw(double amount) {
        mBalance -= amount;
        Log.d(TAG, "Withdraw: " + amount);
        if (mBalance < 0) {
            mBalance -= OVERDRAFT_FEE;
            Log.d(TAG, "Overdraft Charge: " + mBalance);
        }
    }

    public void deposit(double amount) {
        mBalance += amount;
        Log.d(TAG, "Deposit: " + amount);
    }

    public double getBalance() {
        return mBalance;
    }
}

@@ -45,16 +45,45 @@
 l.Log;%0A%0A
+import java.util.ArrayList;%0A%0A
 /**%0A * C
@@ -229,23 +229,39 @@
 ate 
-d
+ArrayList%3CD
 ouble
+%3E
  m
-Balance
+Transactions
 ;%0A  
@@ -310,16 +310,85 @@
  = 30;%0A%0A
+    BankAccount() %7B%0A        mTransactions = new ArrayList%3C%3E();%0A    %7D%0A
     publ
@@ -434,25 +434,33 @@
    m
-Balance -= 
+Transactions.add(-
 amount
+)
 ;%0A  
@@ -512,24 +512,28 @@
     if (
-m
+get
 Balance
+()
  %3C 0) %7B%0A
@@ -548,89 +548,84 @@
     
-mBalance -= OVERDRAFT_FEE;%0A            Log.d(TAG, %22Overdraft Charge: %22 + mBalance
+Log.d(TAG, %22Overdraft Charge%22);%0A            mTransactions.add(-OVERDRAFT_FEE
 );%0A 
@@ -694,25 +694,32 @@
    m
-Balance += 
+Transactions.add(
 amount
+)
 ;%0A  
@@ -810,23 +810,155 @@
     
-return mBalance
+double total = 0;%0A        for(int i = 0; i %3C mTransactions.size(); i++) %7B%0A            total += mTransactions.get(i);%0A        %7D%0A        return total
 ;%0A  

Refactor Balance