-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbanking.java
More file actions
124 lines (100 loc) · 3.59 KB
/
banking.java
File metadata and controls
124 lines (100 loc) · 3.59 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Source code is decompiled from a .class file using FernFlower decompiler.
import java.util.Scanner;
class bank {
private int bal = 50000;
private int pwd;
private int acc = 220305510;
bank() {
}
public void deposit(int var1) {
System.out.println("Enter Password: ");
Scanner var2 = new Scanner(System.in);
this.pwd = var2.nextInt();
if (this.pwd == 3700) {
this.bal += var1;
System.out.println("Now you can deposit :" + var1 + "Rs");
System.out.println("Total balance: " + this.bal + "Rs");
} else {
System.out.println("Incorrect password");
}
}
public void withdraw(int var1) {
System.out.println("Enter Password: ");
Scanner var2 = new Scanner(System.in);
this.pwd = var2.nextInt();
if (this.pwd == 3700) {
this.bal -= var1;
System.out.println("Now you Withdraw :" + var1 + "Rs");
System.out.println("Total balance: " + this.bal + "Rs");
} else {
System.out.println("Incorrect password");
}
}
public void Checkbal() {
System.out.println("Enter Password: ");
Scanner var1 = new Scanner(System.in);
this.pwd = var1.nextInt();
if (this.pwd == 3700) {
System.out.println("Total balance: " + this.bal + "Rs");
} else {
System.out.println("Incorrect password");
}
}
public void Transfer(int var1) {
System.out.println("Enter Password: ");
Scanner var2 = new Scanner(System.in);
this.pwd = var2.nextInt();
System.out.println("Enter account : ");
this.acc = var2.nextInt();
// this.var1 = var2.nextInt();
if (this.pwd == 3700) {
if (this.acc == 220305510) {
System.out.println("Before Amount transfer balance: " + this.bal + "Rs");
System.out.println("Now you Transfer :" + var1 + "Rs");
this.bal -= var1;
System.out.println("After Amount transfer balance: " + this.bal + "Rs");
} else {
System.out.println("Invaild account Number you entered");
}
} else {
System.out.println("Incorrect password");
}
}
}
public class banking {
// private static int var1;
public static void main(String[] args) {
bank BK = new bank();
// BK.deposit(var1.nextInt());
// System.out.println("Enter How much Amount desposit you : ");
int var1;
int ch;
System.out.println("1.Deposite :");
System.out.println("2.Withdraw :");
System.out.println("3.CheckBalance :");
System.out.println("4.TranferMoney :");
System.out.println("Enter Your Choice :");
// taking input from user : deposit,withdraw , Checkbal, Transfer
Scanner sc2 = new Scanner(System.in);
ch = sc2.nextInt();
switch(ch)
{
case 1:
System.out.println("Enter How much Amount desposit you : ");
BK.deposit(var1 = sc2.nextInt());
break;
case 2:
System.out.println("Enter How much Amount withdraw you : ");
BK.withdraw(var1 = sc2.nextInt());
break;
case 3:
BK.Checkbal();
break;
case 4:
System.out.println("Enter How much Amount you want to Tranfer : ");
BK.Transfer(var1 = sc2.nextInt());
break;
default : System.out.println("You Choice This Service not Avaliable Right Now, Try Again!");
}
}
}