-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBank.java
More file actions
154 lines (148 loc) · 4.04 KB
/
Bank.java
File metadata and controls
154 lines (148 loc) · 4.04 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
import java.io.*;
import amount.Transaction;
class Operations
{
int ch,dob,pan,phno,add,amount,pin,Amt;
String acc_type,branch,cust,gen,email,ad,name;
final void account_type()throws Exception
{
DataInputStream i=new DataInputStream(System.in);
System.out.println("1.Savings");
Thread.sleep(1000);
System.out.println("2.Current");
Thread.sleep(1000);
System.out.println("3.Fixed/Term Deposit");
Thread.sleep(1000);
System.out.println("4.Others");
System.out.println("Enter the Account Type");
acc_type=i.readLine();
}
final void create_account()throws Exception
{
RandomAccessFile a=new RandomAccessFile("record.txt","rw");
DataInputStream i=new DataInputStream(System.in);
System.out.println("Enter the branch name");
branch=i.readLine();
System.out.println("Enter the name of the customer");
cust=i.readLine();
System.out.println("Enter the Customer address");
ad=i.readLine();
System.out.println("Enter the gender");
gen=i.readLine();
System.out.println("Enter Date of Birth");
dob=Integer.parseInt(i.readLine());
System.out.println("Enter the pan card N.o");
pan=Integer.parseInt(i.readLine());
System.out.println("Enter the phone number");
phno=Integer.parseInt(i.readLine());
System.out.println("Enter the aadhaar card number");
add=Integer.parseInt(i.readLine());
System.out.println("Enter the email ID");
email=i.readLine();
System.out.println("Please attach the following documents zerox");
System.out.println("1.Aadhaar card");
System.out.println("2.Pan card");
System.out.println("3.Passport Photo");
System.out.println("4.Address Proof");
a.writeUTF(acc_type);
a.writeUTF(branch);
a.writeUTF(cust);
a.writeUTF(ad);
a.writeUTF(gen);
a.writeInt(dob);
a.writeInt(pan);
a.writeInt(phno);
a.writeInt(add);
a.writeUTF(email);
}
final void acc_details()throws Exception
{
RandomAccessFile r=new RandomAccessFile("record.txt","r");
r.seek(0);
acc_type=r.readUTF();
branch=r.readUTF();
cust=r.readUTF();
ad=r.readUTF();
gen=r.readUTF();
dob=r.readInt();
pan=r.readInt();
phno=r.readInt();
add=r.readInt();
email=r.readUTF();
System.out.println("!!!!!!!!!!!!!!!!!!!!!!Your Account Details!!!!!!!!!!!!!!!!!!!!!!");
System.out.println("=======================================");
System.out.println("Your account number is 120510011010045");
System.out.println("Your branch name is "+branch);
System.out.println("The customer name is "+cust);
System.out.println("The customer address is "+ad);
System.out.println("The Gender is "+gen);
System.out.println("The date of birth is "+dob);
System.out.println("The pan card number is "+pan);
System.out.println("The phone number is "+phno);
System.out.println("The addhar number is "+add);
System.out.println("The Email Id is "+email);
System.out.println("=======================================");
}
}
class Bank extends Operations
{
public static void main(String args[])throws Exception
{
Bank b=new Bank();
Transaction t=new Transaction();
int ch;
DataInputStream i=new DataInputStream(System.in);
Thread.sleep(1000);
System.out.println("==============================");
System.out.println("Welcome To GRD Bank");
System.out.println("=============================");
Thread.sleep(1000);
System.out.println("1.Account Type");
Thread.sleep(1000);
System.out.println("2.Create Account");
Thread.sleep(1000);
System.out.println("3.Transaction");
Thread.sleep(1000);
System.out.println("4.Account Details");
Thread.sleep(1000);
System.out.println("5.Exit");
do
{
System.out.println("Enter the choice");
ch=Integer.parseInt(i.readLine());
switch(ch)
{
case 1:
{
b.account_type();
break;
}
case 2:
{
b.create_account();
break;
}
case 3:
{
t.transact();
break;
}
case 4:
{
b.acc_details();
break;
}
case 5:
{
System.out.println("exit");
System.exit(0);
break;
}
default:
{
System.out.println("Please Enter a valid option");
}
}
}while(ch!=5);
}
}