-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankTest.java
More file actions
40 lines (25 loc) · 930 Bytes
/
Copy pathBankTest.java
File metadata and controls
40 lines (25 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public class BankTest
{
public static void main(String args[])
{
BankAccount mine = new BankAccount();
BankAccount yours = new BankAccount(1000);
mine.deposit(56.75);
if (yours.withdraw(1200))
System.out.println("Good Transaction");
else
System.out.println("Unable to complete transaction");
double cash = yours.getBalance();
System.out.println(cash);
CheckingAccount his = new CheckingAccount(100);
his.deposit(10);
his.withdraw(50);
his.deposit(20);
his.deposit(10);
int numTimes = his.getTransactionCount();
his.deductFees();
cash = his.getBalance();
numTimes = his.getTransactionCount();
System.out.println(cash);
}
}