-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAtmUygulamasi.java
60 lines (47 loc) · 1.88 KB
/
AtmUygulamasi.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
import java.util.Scanner;
public class AtmUygulamasi {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
String passWord,userName;
int balance = 1500,price=0,select;
System.out.print("Kullanıcı adınızı giriniz: ");
userName = inp.nextLine();
System.out.print("Parolanızı giriniz: ");
passWord = inp.nextLine();
if(userName.equals("patika") && passWord.equals(("dev123"))){
System.out.println("X Bankasına Hoşgeldiniz!");
System.out.println("Gerçekleştirmek İstediğiniz İşlemi Seçiniz:");
System.out.println("1-Para yatırma\n" +
"2-Para çekme\n" +
"3-Bakiye sorgulama\n" +
"4-Çıkış yapma");
select = inp.nextInt();
switch(select){
case 1:
System.out.println("Yatırmak istediğiniz miktarı giriniz: ");
price = inp.nextInt();
balance=+price;
break;
case 2:
System.out.println("Çekmek istediğiniz tutarı giriniz: ");
price = inp.nextInt();
if(price>balance){
System.out.println("Yetersiz bakiye.. ");
}
else{
balance-=price;
}
break;
case 3:
System.out.println("Bakiyeniz: "+balance);
break;
case 4:
System.out.println("Çıkış yapıldı");
break;
}
}
else{
System.out.println("Hatalı giriş yaptınız, lütfen tekrar deneyiniz...");
}
}
}