-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathATM.java
60 lines (55 loc) · 2.24 KB
/
ATM.java
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
package ATMINTERFACE;
import java.util.Scanner;
public class ATM {
public static void main(String args[]){
System.out.println("WELCOME TO ATM!!!");
System.out.println("\nSelect any one option!");
System.out.println("1.REGISTER\n 2.EXIT");
System.out.println("Enter your option :");
Scanner sc=new Scanner(System.in);
int ch;
ch=sc.nextInt();
if (ch==1){
ATMFUNC Atmm=new ATMFUNC();
while(ch==1){
System.out.println("\nSelect any one option!");
System.out.println("1.LOGIN\n2.EXIT");
System.out.println("Enter your option :");
int op=sc.nextInt();
if (op==1){
if(Atmm.login()){
boolean isFin=false;
while(!isFin){
System.out.println("\nSelect any option : ");
System.out.println("1.DEPOSIT\n2.WITHDRAW\n3.TRANSFER\n4.TRANSACTION HISTORY\n5.CHECK BALANCE\n6.EXIT");
System.out.println("Enter your option :");
int c=sc.nextInt();
switch(c){
case 1 : Atmm.deposit();
break;
case 2 : Atmm.withdraw();
break;
case 3 : Atmm.transfer();
break;
case 4 : Atmm.transHistory();
break;
case 5 : Atmm.checkBal();
break;
case 6 : isFin=true;
break;
default: System.out.println("Invalid option!");
}
}
}
}
else{
System.exit(0);
}
}
}
else {
System.out.print("Please Collect Your Card \n");
System.exit(0);
}
}
}