-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinalCall.java
More file actions
34 lines (31 loc) · 1.16 KB
/
FinalCall.java
File metadata and controls
34 lines (31 loc) · 1.16 KB
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
package ConsoleBasedBankingApplication;
class FinalCall{
protected void fromSaving() {
System.out.println("-------------------------");
SavingAccount savingAcc = new SavingAccount();
savingAcc.openAccount();
savingAcc.deposit(1000);
long checkBalance = savingAcc.checkBalance();
System.out.println("Current balance: "+checkBalance);
long withdraw = savingAcc.withdraw(500);
System.out.println("Withdrawn: "+withdraw);
checkBalance = savingAcc.checkBalance();
System.out.println("Current balance: "+checkBalance);
savingAcc.closeAccount();
System.out.println("-------------------------");
}
protected void fromCurrent() {
System.out.println("-------------------------");
CurrentAccount currentAcc = new CurrentAccount();
currentAcc.openAccount();
currentAcc.deposit(20000);
long checkBalance = currentAcc.checkBalance();
System.out.println("Current balance: "+checkBalance);
long withdraw = currentAcc.withdraw(500);
System.out.println("Withdrawn: "+withdraw);
checkBalance = currentAcc.checkBalance();
System.out.println("Current balance: "+checkBalance);
currentAcc.closeAccount();
System.out.println("-------------------------");
}
}