Class BankAccount

java.lang.Object
  |
  +--BankAccount

public class BankAccount
extends java.lang.Object

BankAccount class


Constructor Summary
BankAccount(int balance, int accountNumber, int monthlyFee, double interest)
          Create BankAccount object
 
Method Summary
 void addInterest()
           
 void applyMonthlyFee()
           
 int deposit(int amount)
          Deposit money in bank account
static void main(java.lang.String[] args)
           
 java.lang.String toString()
          Returns String with account info
 java.lang.String withdraw(int amount)
          Withdraw money from bank account if sufficient funds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BankAccount

public BankAccount(int balance,
                   int accountNumber,
                   int monthlyFee,
                   double interest)
Create BankAccount object
Parameters:
balance - bank account balance in cents
accountNumber - account number
monthlyFee - monthly fee
interest - interest rate (.05 = 5%, .10 = 10%, etc.)
Method Detail

deposit

public int deposit(int amount)
Deposit money in bank account
Parameters:
amount - amount to deposit in cents
Returns:
new balance

withdraw

public java.lang.String withdraw(int amount)
Withdraw money from bank account if sufficient funds
Parameters:
amount - amount to withdraw in cents
Returns:
String with amount withdrawn and new balance if amount > balance else returns "Insufficient Funds"

toString

public java.lang.String toString()
Returns String with account info
Overrides:
toString in class java.lang.Object
Returns:
String with account number, balance, monthly fee, interest rate

addInterest

public void addInterest()

applyMonthlyFee

public void applyMonthlyFee()

main

public static void main(java.lang.String[] args)