// line 1
Simple representation of a bank account // line 2
// line 3
@author
@version
public class SimpleBankAccount{
private double balance;
// line 11
Constructor for objects of class SimpleBankAccount // line 12
public SimpleBankAccount(){
balance = 0.0;
}
// line 18
Add money to the balance // line 19
// line 20
@param amount
@return
public void deposit(double amount){
balance = balance + amount;
}
// line 28
Remove money from the balance // line 29
// line 30
@param amount
@return
public boolean withdraw(double amount){
if( balance - amount >= 0 ){
balance -= amount;
return true;
}else{
return false;
}
}
// line 43
Get the balance // line 44
// line 45
@return
public double getBalance(){
return balance;
}
}