0% found this document useful (0 votes)
53 views6 pages

Project 1

Uploaded by

atulofficialx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views6 pages

Project 1

Uploaded by

atulofficialx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

PROJECT-1

Develop a Console Based Application using JAVA to


Search Bank name and Address using its IFSC Code

5
PROJECT 1: SEARCH BANK BY IFSC

-:Project Overview:-

About the Project: This java based console application takes an IFSC code from the user and
checks for the same ifsc code in RBI-IFSC.txt file which is actually a merged file of all ifsc codes
obtained from RBI September 2015 ifsc code list. If the ifsc code is found then it displays the
bank’s name , MICR code and address.

Java Packages used:


1. import java.util.*;
2. import java.io.*;
CLASS searchBank:
1. String input() :- inputs Ifsc after validating its length
2. void output() :- prints the output( Bank name, Micr code,
Address)
3. void error404() :- Prints error due to invalid length of ifsc
4. void error504() :- Prints error if entered ifsc is not found in
RBI-IFSC.txt
5. void main() :- Controls the functioning of program and searches
the ifsc in RBI-IFSC.txt file
RBI-IFSC.txt file: stores records of all bank’s ifsc code and bank name, micr code and address
As per RBI-2015 september IFSC records.

6
PROJECT 1: SEARCH BANK BY IFSC

-:Source code:-
import java.util.*;
import java.io.*;
public class searchBank{
public String input(){//inputs IFSC code
Scanner sc=new Scanner(System.in);
String ifsc=" ";
System.out.println("");
System.out.println("|-----------------------------------------|");
System.out.println("|----Find Bank Details Using IFSC CODE----|");
System.out.println("| |");
System.out.println("| |");
System.out.println("|Enter your 11-Digit IFSC code: |");
System.out.print("|");
ifsc=sc.next();
if(ifsc.length()!=11){//validates ifsc by its lenght
error404();
}
System.out.println("|-----------------------------------------|");
System.out.println("");
return ifsc;
}
//displays output
public void output(String ifsc,String micr,String bank,String add){
System.out.println("###########################################");
System.out.println("#");
System.out.println("#SEARCH SUCCESSFUL...");
System.out.println("#");
System.out.println("#IFSC CODE::"+ifsc);
System.out.println("#MICR CODE::"+micr);
System.out.println("#BANK NAME::"+bank);
System.out.println("#ADDRESS ::"+add);
System.out.println("#");
System.out.println("###########################################");
}
//show error if invalid size
public void error404(){
System.out.println("|ERROR 404: INVAILD IFSC |");
System.out.println("|Reason:Invalid size |");
System.out.println("|-----------------------------------------|");
System.exit(0);
}

7
PROJECT 1: SEARCH BANK BY IFSC

//shows error if IFSC not found


public void error504(){
System.out.println("###########################################");
System.out.println("#ERROR-504");
System.out.println("#Reason::Either INVALID or Bank not listed ");
System.out.println("# under RBI-2015 IFSC list");
System.out.println("#Visit:: https://www.rbi.org.in/home.aspx");
System.out.println("# for latest info");
System.out.println("###########################################");
System.exit(0);
}
//program controller
public static void main(String args[])throws IOException{
FileReader fin=new FileReader("RBI-IFSC.txt");
BufferedReader ffin= new BufferedReader(fin);
Scanner s1=new Scanner(new File("RBI-IFSC.txt"));
searchBank ob=new searchBank();
String s,ifsc="",micr="",bank="",add="";
s=ob.input();
System.out.println("*********Searching Records...**************");
while(s1.hasNext()){//searches in RBI-IFSC.txt
String temp=s1.next();
if(temp.equals(s)){
ifsc=s;
micr=s1.next();
temp=s1.next();
while(!temp.equals("!")){
bank=bank+" "+temp;
temp=s1.next();
}
add=s1.nextLine();
}
}
s1.close();
if(ifsc.equals("")){
ob.error504();
}
ob.output(ifsc,micr,bank,add);
}
}

8
PROJECT 1: SEARCH BANK BY IFSC

-:Output Snapshots:-
When IFSC of invalid length is entered

When IFSC not Found in RBI-IFSC.txt

9
PROJECT 1: SEARCH BANK BY IFSC

When IFSC is successfully found in RBI-IFSC.txt

10

You might also like