-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATM.java
More file actions
78 lines (61 loc) · 2.5 KB
/
Copy pathATM.java
File metadata and controls
78 lines (61 loc) · 2.5 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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String userName,password;
int right=3;
int select;
int price;
int total=1500;
boolean processing=true;
while (right>0){
System.out.print("Kullanici adinizi giriniz: ");
userName=input.nextLine();
System.out.print("Sifrenizi giriniz: ");
password=input.nextLine();
if (userName.equals("patika")&&password.equals("java101")){
while (processing){
System.out.println("Kodluyoruz bankasina hos geldiniz! ");
System.out.println("1-Para Yatirma\n"+"2-Para Cekme\n"+"3-Bakiye Sorgulama\n"+"4-Cikis Yap!");
select=input.nextInt();
switch (select){
case 1:
System.out.println("Yatirmak istediginiz miktari giriniz: ");
price=input.nextInt();
total+=price;
break;
case 2:
System.out.println("Cekmek istediginiz miktari giriniz: ");
price=input.nextInt();
if (price>total){
System.out.println("Bakiyenizde o kadar para yok! ");
}else {
total-=price;
}
break;
case 3:
System.out.println("Bakiyeniz: "+total);
break;
case 4:
System.out.println("Sistemden cikiliyor! ");
processing=false;
right=0;
break;
default:
System.out.println("Lutfen tekrar deneyiniz: ");
break;
}
}
}else {
right--;
if (right==0){
System.out.print("Hesabiniz bloke olmustur! ");
processing=false;
}else {
System.out.println("Yanlis sifre ya da kullanici adi girdiniz! ");
System.out.println("Kalan hakkiniz: "+right);
}
}
}
}
}