Advertisement
vp0415

lec2.2.1

Oct 12th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. public class Account {
  2.    
  3.     private double balance;
  4.  
  5.     public Account( double initialBalance)
  6.     {
  7.     if (initialBalance > 0.0)
  8.         balance = initialBalance;
  9.     }
  10.  
  11.     public void debit( double amount)
  12.     {
  13.     balance = balance - amount;
  14.     }
  15.  
  16.     public double getBalance()
  17.     {
  18.     return balance;
  19.     }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement