SHARE
TWEET

APCS2012_C3X1_BankAccountTester.java

calcpage Sep 28th, 2012 144 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top