public class SavingsAccountDemo
1: //SavingsAccountDemo.java
2:
3: public class SavingsAccountDemo
4: {
5: public static void main(String[] args)
6: {
7: SavingsAccount.setInterestRate(0.01);
8: SavingsAccount mySavings = new SavingsAccount();
9: SavingsAccount yourSavings = new SavingsAccount();
10:
11: System.out.println("I deposited $10.75.");
12: mySavings.deposit(10.75);
13: System.out.println("You deposited $75.");
14: yourSavings.deposit(75.00);
15: System.out.println("You deposited $55.");
16: yourSavings.deposit(55.00);
17:
18: double cash = yourSavings.withdraw(15.75);
19: System.out.println("You withdrew $" + cash + ".");
20: if (yourSavings.getBalance() > 100.00)
21: {
22: System.out.println("You received interest.");
23: yourSavings.addInterest();
24: }
25:
26: System.out.println("Your savings is $" + yourSavings.getBalance());
27: System.out.print("My savings is $");
28: SavingsAccount.showBalance(mySavings);
29: System.out.println();
30: int count = SavingsAccount.getNumberOfAccounts();
31: System.out.println("We opened " + count + " savings accounts today.");
32: }
33: }