Advertisement
wreed12345

Untitled

Aug 21st, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. public class BankProgram{
  2.     private String name;
  3.     private double balance;
  4.     private int id;
  5.     private static int amountOfIds = 0;
  6.  
  7.     public BankProgram(String name, double balance){
  8.         amountOfIds ++;
  9.         this.name = name;
  10.         this.balance = balance;
  11.         this.id = amountOfIds;
  12.     }
  13.    
  14.     public double deposit(double amount){
  15.         balance += amount;
  16.         return balance;
  17.     }
  18.    
  19.     public double withdrawl(double amount) {
  20.         balance -= amount;
  21.         return balance;
  22.     }
  23.    
  24.     public double getBalance(){
  25.         return balance;
  26.     }
  27.    
  28.     public int getID(){
  29.         return id;
  30.     }
  31.    
  32.     public String getName(){
  33.         return name;
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement