forked from shankar9834/BankManagementSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheck_Balance.java
58 lines (54 loc) · 2.52 KB
/
Check_Balance.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
//package Main;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Scanner;
interface Check_Balance extends Imp_Functions
{
default public void check_balance(String Account_Number)
{
try
{
Scanner input = new Scanner(System.in);
String file_name = Account_Number;
file_name = file_name + ".txt";
FileReader fr = new FileReader(file_name);
BufferedReader bfr = new BufferedReader(fr);
String account = bfr.readLine();
String name = bfr.readLine();
String username = bfr.readLine();
String password = bfr.readLine();
String pin = bfr.readLine();
String balance = bfr.readLine();
String dob = bfr.readLine();
String mobile = bfr.readLine();
String aadhaar = bfr.readLine();
String address = bfr.readLine();
bfr.close();
System.out.println("");
System.out.println("--------------------------------------------------------------------------------------");
System.out.println("| STUDENTS CORPORATE BANK |");
System.out.println("|------------------------------------------------------------------------------------|");
System.out.println("| WELCOME... " + name);
System.out.print("| Enter your 4 digit PIN to confirm : ");
String pin2 = input.next();
if (compare_string(pin, pin2))
{
System.out.println("|------------------------------------------------------------------------------------|");
System.out.println("| Your Current Balance is : " + balance);
System.out.println("|------------------------------------------------------------------------------------|");
}
else
{
System.out.println("|------------------------------------------------------------------------------------|");
System.out.println("| Wrong PIN... |");
System.out.println("|------------------------------------------------------------------------------------|");
}
}
catch (Exception e)
{
System.out.println("No Account found with Account Number : " + Account_Number);
}
}
}