-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDrive.java
18 lines (18 loc) · 877 Bytes
/
Drive.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class Drive {
public static void main(String[] args) {
Account account = new CheckingAccount("Soumya", "Nayar", 120.0);
double debitAmount;
double creditAmount;
System.out.println(account.toString());
debitAmount = 30;
System.out.println("Balance after debiting " + debitAmount + " is: " + account.debitTransaction(debitAmount));
debitAmount = 8;
System.out.println("Balance after debiting " + debitAmount + " is: " + account.debitTransaction(debitAmount));
creditAmount = 12.8;
System.out
.println("Balance after crediting " + creditAmount + " is: " + account.creditTransaction(creditAmount));
creditAmount = 15;
System.out
.println("Balance after crediting " + creditAmount + " is: " + account.creditTransaction(creditAmount));
}
}