-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAtm.java
More file actions
85 lines (80 loc) · 1.89 KB
/
BankAtm.java
File metadata and controls
85 lines (80 loc) · 1.89 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import java.lang.*;
import java.util.*;
public class BankAtm
{
public static void main(String args[])
{
int a=10000;
int b;
int c;
int d;
int e;
int f=9943;
System.out.println(" Welcome to SBI bank");
System.out.println("");
System.out.println("Enter your four digit pin : ");
Scanner ss=new Scanner(System.in);
e=ss.nextInt();
if(e==f)
{
while(true)
{
System.out.println("1] Balance enquiry");
System.out.println("2] Withdrawal");
System.out.println("3] Deposit ");
System.out.println("4] recipt");
System.out.println("5] exit");
Scanner s=new Scanner(System.in);
b=s.nextInt();
switch(b)
{
case 1 :
System.out.println("Balance amount : "+a);
System.out.println("");
System.out.println("");
break;
case 2 :
System.out.println("Enter the amount to withdraw : ");
c=s.nextInt();
if(c<=a)
{
System.out.println("Collect your cash : "+c);
a=a-c;
System.out.println("");
System.out.println("");
}
else
{
System.out.println("Insufficient money");
System.out.println("");
System.out.println("");
}
break;
case 3 :
System.out.println("Enter the amount to deposit : ");
d=s.nextInt();
a=a+d;
System.out.println("Balance : "+a);
System.out.println("");
System.out.println("");
break;
case 4 :
System.out.println(" Indian bank");
System.out.println("Account no : xxxx xxxx xx98");
System.out.println("Phone no : 9943322935");
System.out.println("Balance : "+a);
System.out.println("Customer support : 8248690154");
System.out.println("");
System.out.println("");
break;
case 5 :
System.exit(0);
}
}
}
else
{
System.out.println("Incorrect pin");
}
}
}