calcpage

APCS2012_C3X1_BankAccountTester.java

Sep 28th, 2012
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.62 KB | None | 0 0
  1. /*
  2. BankAccountTester.java      MrG 2012.0925
  3. purpose:    test a BankAccount class maintaining a balance
  4. required files: BankAccountTester.java          main class
  5.         BankAccount.java            derived class
  6. translator: javac BankAccountTester.java
  7. interpreter:    java BankAccountTester
  8. */
  9.  
  10. //main routine
  11. public class BankAccountTester
  12. {
  13.     public static void main(String[] args)
  14.     {
  15.         BankAccount bob = new BankAccount();
  16.         System.out.println("balance = $" + bob.getBalance());
  17.         bob.deposit(1000000);
  18.         System.out.println("balance = $" + bob.getBalance());
  19.         bob.withdraw(5000.95);
  20.         System.out.println("balance = $" + bob.getBalance());
  21.     }
  22. }
Add Comment
Please, Sign In to add comment