/**
 * A simple Bank Account for Javadoc-ing
 *
 * @author Zack Butler
 */

public class Bank2 {

    double balance;

    /**
     * Creates a BankAccount with zero balance
     *
     */
    public Bank2() {
        balance = 0;
    }

    /**
     * Creates a BankAccount with given balance
     *
     * @param balance initial balance
     */
    public Bank2(double balance) {
        this.balance = balance;
    }


    /**
     * Puts more money in the account
     *
     * @param money amount to deposit
     */
    public void deposit(double money) {
        balance += money;
    }

    /**
     * Withdraws given amount of money (or not!)
     *
     * @param money amount to withdraw
     * @return success of withdrawal
     */
    public boolean withdraw (double money) {
        if (money > balance) 
            return false;
        balance -= money;
        return true;
    }

    /**
     * Returns the current balance
     *
     * @return current balance
     */
    public double getBalance() {
        return balance;
    }

    /**
     * override the generic toString method
     *
     * @return String representation of bank account
     */
    public String toString() {
	return "Bank account balance: $" + balance;
    }
}

