-
Notifications
You must be signed in to change notification settings - Fork 0
/
bank.java
62 lines (48 loc) · 1.12 KB
/
bank.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
61
62
import java.io.*;
class bank
{
int account;
String name;
int balance;
int input;
static BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
void set() throws Exception
{
System.out.print("Enter the account number: ");
account= Integer.parseInt(br.readLine());
System.out.print("Enter the name: ");
name= br.readLine();
System.out.print("Enter the balance: ");
balance= Integer.parseInt(br.readLine());
}
void show() throws Exception
{
System.out.println("Account Number: "+account);
System.out.println("Name: " + name);
System.out.println("Balance: " + balance);
}
void deposit() throws Exception
{
System.out.println("Enter the account number: ");
input= Integer.parseInt(br.readLine());
}
public static void main(String args[]) throws Exception
{
bank b[] = new bank[3];
for(int i=0;i<b.length;i++)
{
b[i]= new bank();
b[i].set();
}
while(true)
{
System.out.print("Enter Your Acount Number::");
int inp= Integer.parseInt(br.readLine());
for(int i=0;i<b.length;i++)
{
if(inp==b[i].account)
b[i].show();
}
}
}
}