1 ÏÕÖ×public class FixedTermSavingsAccountDriver
 2 ÏÏ§{
 3 ÏÏ§
 4 ÏÏ§ÏÞßàpublic static void main (String [] args)
 5 ÏÏ§ÏÏ§{
 6 ÏÏ§ÏÏ§
 7 ÏÏ§ÏÏ¨¹íÏFixedTermSavingsAccount  firstAccount, secondAccount;
 8 ÏÏ§ÏÏ¨¹íÏString  tempString;
 9 ÏÏ§ÏÏ¨¹íÏint     tempInt;
10 ÏÏ§ÏÏ¨¹íÏdouble  tempDouble;
11 ÏÏ§ÏÏ§
12 ÏÏ§ÏÏ§//1.
13 ÏÏ§ÏÏ¨¹¹ÏfirstAccount = new FixedTermSavingsAccount  ("adamses");
14 ÏÏ§ÏÏ§
15 ÏÏ§ÏÏ§
16 ÏÏ§ÏÏ§//2.
17 ÏÏ§ÏÏ¨¹¹ÏsecondAccount = new FixedTermSavingsAccount  ("harrisnl");
18 ÏÏ§ÏÏ§
19 ÏÏ§ÏÏ§
20 ÏÏ§ÏÏ§//3.
21 ÏÏ§ÏÏ¨¹¹ÏtempInt = firstAccount.compareTo(secondAccount);  
22 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempInt + " expected:  -1" );
23 ÏÏ§ÏÏ§
24 ÏÏ§ÏÏ§//4.
25 ÏÏ§ÏÏ¨¹¹ÏtempString = secondAccount.deposit(12345.6462);
26 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: balance updated ");
27 ÏÏ§ÏÏ§// okay if you echo the balance
28 ÏÏ§ÏÏ§
29 ÏÏ§ÏÏ§//5.
30 ÏÏ§ÏÏ¨¹¹ÏtempString = firstAccount.getAccountID();
31 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: FT-0000000000");
32 ÏÏ§ÏÏ§// format as well as number matters
33 ÏÏ§ÏÏ§
34 ÏÏ§ÏÏ§//6.
35 ÏÏ§ÏÏ¨¹¹ÏtempString = secondAccount.getAccountID();
36 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: FT-0000000001");
37 ÏÏ§ÏÏ§// format as well as number matters -- no commas, exact spacing,
38 ÏÏ§ÏÏ§// correct number of digits
39 ÏÏ§ÏÏ§
40 ÏÏ§ÏÏ§//7.
41 ÏÏ§ÏÏ¨¹¹ÏtempDouble = secondAccount.getBalance();
42 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempDouble + " expected: 12345.6462");
43 ÏÏ§ÏÏ§// since getBalance returns a double, format change not expected  
44 ÏÏ§ÏÏ§
45 ÏÏ§ÏÏ§//8.
46 ÏÏ§ÏÏ¨¹¹ÏtempString = secondAccount.getBalanceMessage();
47 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: Balance: $12,345.65");
48 ÏÏ§ÏÏ§// here format matters -- dollar sign, commas, and only 2 places'
49 ÏÏ§ÏÏ§// after decimal point are required  
50 ÏÏ§ÏÏ§
51 ÏÏ§ÏÏ§//9.
52 ÏÏ§ÏÏ¨¹¹ÏtempString = secondAccount.getUserName();
53 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: harrisnl@jmu.edu");
54 ÏÏ§ÏÏ§
55 ÏÏ§ÏÏ§//10.
56 ÏÏ§ÏÏ¨¹¹ÏtempString = firstAccount.getUserName();
57 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: adamses@jmu.edu");
58 ÏÏ§ÏÏ§
59 ÏÏ§ÏÏ§
60 ÏÏ§ÏÏ§//11.
61 ÏÏ§ÏÏ¨¹¹ÏtempString = firstAccount.deposit(-23.65);
62 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: balance not updated");
63 ÏÏ§ÏÏ§// can say something about negative numbers not allowed
64 ÏÏ§ÏÏ§// can echo amount in currency format 
65 ÏÏ§ÏÏ§
66 ÏÏ§ÏÏ§//12.
67 ÏÏ§ÏÏ¨¹¹ÏtempString = firstAccount.deposit(42.73);
68 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: balance updated");
69 ÏÏ§ÏÏ§// can say something about negative numbers not allowed
70 ÏÏ§ÏÏ§// can echo amount in currency format 
71 ÏÏ§ÏÏ§
72 ÏÏ§ÏÏ§
73 ÏÏ§ÏÏ§//13.
74 ÏÏ§ÏÏ¨¹¹ÏtempString = firstAccount.deposit(1004.52);
75 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected: balance updated");
76 ÏÏ§ÏÏ§// can say something about negative numbers not allowed
77 ÏÏ§ÏÏ§// can echo amount in currency format 
78 ÏÏ§ÏÏ§
79 ÏÏ§ÏÏ§//14.
80 ÏÏ§ÏÏ¨¹¹ÏtempString = firstAccount.getBalanceMessage();
81 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempString + " expected:  Balance: $1,047.25" );
82 ÏÏ§ÏÏ§// money format is required; so is Balance:
83 ÏÏ§ÏÏ§
84 ÏÏ§ÏÏ§//15.
85 ÏÏ§ÏÏ¨¹¹ÏtempInt = secondAccount.compareTo(firstAccount);
86 ÏÏ§ÏÏ¨¹¹ÏSystem.out.println (tempInt + " expected:  1" );
87 ÏÏ§ÏÏ§
88 ÏÏ§ÏÏ§
89 ÏÏ§ÏÏ©} // end main
90 ÏÏ§
91 ÏÏ©} // end class 
92 
93