- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleAtm.java
More file actions
Latest commit
21 lines (18 loc) · 612 Bytes
/
Copy pathSimpleAtm.java
File metadata and controls
21 lines (18 loc) · 612 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
++importjava.util.Scanner;
publicclassSimpleAtm {
publicstaticvoidmain(String[] args) {
Scannerinput = newScanner(System.in);
System.out.print("Current Balance: ");
floatcb = input.nextFloat();
System.out.print("Withdrawal Amount: ");
floatwa = input.nextFloat();
floatbal = 0.0f;
if (cb > wa){
bal = (cb - wa);
System.out.println("Withdrawal Successful ! New balance = "+ bal);
}
else{
System.out.println("Error. Insufficient Balance.");
}
}
}