Академический Документы
Профессиональный Документы
Культура Документы
Bachelor of Technology
In
Mechanical Engineering
By
ID NO
NAME
14007074
N.Raghavendra
14007476
P.Satya Mahesh
14007343
B.Ravi kumar
14007405
Sivasai dattu
K L University
Green Fields, Vaddeswaram, Guntur district-522 502
NOVEMBER 2015
CERTIFICATE
This is to certify that the course based project titled LIBRARY INFORMATION
MANAGEMENT SYSTEM, being submitted by CH.HEMANTH KUMAR (14007026) in
partial fulfillment for the award of degree of Bachelor
of
Technology in
Head of the
Guide
Dr. Srinath
Asst Professor,
Dept. Computer Science and Engineering
K L University
DEPARTMENT OF MECHANICAL ENGINEERING
DECLARATI
ON
We hereby declare that this project based lab report entitled LIBRARY INFORMATION
MANAGEMENT SYSTEM has been prepared by us in partial fulfillment of the requirement for the
award of degree BACHELOR OF TECHNOLOGY in MECHANICAL ENGINEERING during the
academic year 2015-2016.
I also declare that this project based lab report is of our own effort and it has not been submitted
to any other university for the award of any degree.
CH.HEMANTH
KUMAR(14007026)
K.SAI.PRADEEP REDDY.
(14007571)
M.HARI PRASAD REDDY(14007571)
T.KRISHNA TEJA(14007062)
ACKNOWLEDGEMENTS
My sincere thanks to mr. K. DAVID RAJU in the Lab for their outstanding support throughout
the project for the successful completion of the work
We express our gratitude to Dr. SRINATH, Head of the Department for Mechanical Engineering
for providing us with adequate facilities, ways and means by which we are able to complete this
term paper work.
We would like to place on record the deep sense of gratitude to the honourable Vice Chancellor,
K L University for providing the necessary facilities to carry the concluded term paper work.
we thank all Teaching and Non-Teaching Staff of our department and especially my classmates
and my friends for their support in the completion of our term paper work.
BATCH NO :03
CH.HEMANTH KUMAR(14007026)
K.SAI PRADEEP REDDY(14007572)
M.HARI PRASAD REDDY(14007571)
T.KRISHNA TEJA(14007062)
TABLE OF CONTENTS
Page No
ACKNOWLEDEMENTS
i
ABSTRACT
ii
1.1
1.2
1.3
1.4
2
2.1
2.2
2.3
2.4
2.5
3
4
5
6
Introduction
What is LIBRARY INFORMATION MANAGEMENT SYSTEM
Problem Definition
Platform requirements
Software Requirements Specification
Analysis & Design
Analysis classes
Program Architectural Design
File Design
Input Design
Output Design
Source Code of the project
Results
Conclusion and Future Scope
Bibliography
1
1
1
1
1
2
2
3
6
6
7
8
25
27
28
1. Introduction
1.1 What is The Library Information Management system?
The Library Information Management system is meant for maintaining information of books,
borrowers, issues and returns. It provides search facility of books, borrowers, issues and returns
information. It facilitates to issue and return books in an easier way.
Specification /version
Intel core to duo
1 GB
100 GB
Windows XP
1.
2.
3.
4.
Analysis classes
The software requirements
specifications are analyzed and the
following classes are identified
Class BookInfo
int bookNo;
String bookTitle;
String brideAuthor;
void displayRecord();
Class BorrowerRec
int regNo;
String name;
String address;
void displayRecord();
Class IssueRecord
int regNo;
int bookNo;
String issueDate;
String returnDate;
void displayIssueRecord();
Class returnRecord
int regNo;
int bookNo;
String returnDate;
void displayReturnRecord();
2.2 Program Architectural Design
Various Modules of Marriage Bureau system are identified and are shown
below
Serial Number
1
2
3
4
Various functions in each module are identified and are shown below.
Module Name
Management
of
Book information
2.
Management
Borrowers
information
of
3.
Management
of
Book issues and
returns
S. No.
of
function
1.
2.
3.
4.
1.
2.
3.
4.
1.
2.
3.
4.
Function
To create catalogue
To update catalogue
To search catalogue
To generate Reports
To create Borrowers file
To update Borrowers file
To search Borrowers file
To generate Reports
To issue Books
To return books
To search issues/returns file
To generate Reports
4.
Integration
1.
2.
3.
4.
Management
of
information
To create catalogue
1.2
To update catalogue
1.3
To search catalogue
1.4
To generate reports
2.1
Management
of
Borrowers
information
To create Borrowers file
Here we will be creating borrowers information
with details like regno of borrower, name of
borrower, address of borrowers. Here each and
Brides
Here we will be creating books information with
details like book number,book title,book author.
Here each and every record has to be entered
manually through keyboard, where it asks the user
to save how many records he need to enter. After
entering those records through proper format
those details which user gives can be saved
In this module we will be able to update the
details of books through the records which are
present in the form of book number,book
title,book author. Here we can search those details
either through book number. If any extra details
have to be added we will update those details in
place of previous details.
In this module we will be able to search the
details of books which are present in files, where
details will be in the form of book number, book
title, book author. Here we can search those
details either through book number. Here in this
module formatter file takes control of all the
things for searching the complete details of books
Here in generating reports we will be able to
display all the details of records of books with
details in the form of files.
2.2
2.3
2.4
3
3.1
3.2
3.3
3.4
4
4.1
4.2
To process menu
4.3
Initializations
4.4
To provide Security
bookdata.txt
Field name
bookNo;
bookTitle;
bookAuthor;
Field Type
Integer
String
String
Field Type
Integer
String
String
Field Size
8 digits
10 characters
10 characters
Field Size
8 digits
10 characters
20 characters
For creating a file, the system takes all inputs from keyboard and the writes to file.
A sample input dialog for creating brides information file is shown below
For selecting different functions of the system it displays a menu and reads the
choice of user from keyboard.
Menu
1. Create Books File
2. Add more records to Books file
3. Search by Book NO;
4. Generate Report;
5. Quit
The System also takes input from files(The file design was shown earlier)
2.5 Out Put Design
The output of the system (including reports) is displayed on the console in a
formatted way. The output may also go to a file(file design already explained).
Following is the formatted output for displaying list of brides
List of brides
1.
bookno.: 123
bookname: ss rattan
2.
brideId.: 1234
brideName:
p k nag
End of List
1. For searching details of bride with its bookno the search report will be
displayed as follows
Search by bookno
enter bokno: 123
1.
bookno.: 123
bookName: s s rattan
2. Source Code of the project
package librarymanagementsystem;
import java.io.*;
import java.util.*;
import java.text.DateFormat;
import java.util.Calendar;
import java.text.SimpleDateFormat;
class BookInfo{
int bookNo;
String bookTitle,bookAuthor;
void displayBooksRecord()
{
System.out.println("book no:" +bookNo);
System.out.println("book title:" +bookTitle);
System.out.println("book author" +bookAuthor);
System.out.println("\n");
}
}
class BorrowerRec{
int regNo;
String name,adress;
void displayBorrowerInfo(){
System.out.println("RegNo.:"+regNo);
System.out.println("name:"+name);
System.out.println("adress:"+adress);
System.out.println("\n");
}
}
class IssueRecord{
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Calendar cal = Calendar.getInstance();
int regNo;
String issueDate=dateFormat.format(cal.getTime());
String returnDate;
int bookNo;
void displayIssueRecord(){
System.out.println("regno:"+regNo);
System.out.println("book no:"+bookNo);
System.out.println("issu date:"+issueDate);
System.out.println("return date:"+returnDate);
System.out.println("\n");
}
}
class ReturnRecord{
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Calendar cal = Calendar.getInstance();
int regNo;
String returnDate=dateFormat.format(cal.getTime());;
void displayReturnRecord()
{
System.out.println("reg no:"+regNo);
System.out.println("return date"+returnDate);
System.out.println("\n");
}
}
public class LibraryManagementSystem {
public static void main(String[] args) throws IOException {
System.out.println("\tLibrary Information Management
System\t\n");
int password,option;
int i,num,username;
int choice=0,count=0;
int searchRegNo=0,searchBookNo=0;
String str="";
boolean flag=true;
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
while(true)
{
System.out.println("username");
username=Integer.parseInt(br.readLine());
System.out.println("password");
password=Integer.parseInt(br.readLine());
if(username==14007026&&password==14007026)
break;
else
System.out.println("enter correct username and password");
}
while(flag)
{
System.out.println("\nMENU\n");
System.out.println("1.Books Information");
System.out.println("2.Borrowers Information");
System.out.println("3.Issues And Returns");
System.out.println("4.exit\n");
System.out.println("enter users option");
option=Integer.parseInt(br.readLine());
switch(option)
{
case 1:
System.out.println("BOOKS INFORMATION SYSTEM");
BookInfo record=new BookInfo();
first: while(true)
{
System.out.println("\nMENU\n");
System.out.println("1.create");
System.out.println("2.update");
System.out.println("3.search");
System.out.println("4.records");
System.out.println("5.exit\n");
System.out.println("enter users choice");
choice=Integer.parseInt(br.readLine());
switch(choice){
case 1:
//creating books data
FileWriter fout=new FileWriter("bookdata.txt");
System.out.println("how many records");
num=Integer.parseInt(br.readLine());
for(i=0;i<num;i++)
{
System.out.println("enter book number");
record.bookNo=Integer.parseInt(br.readLine());
System.out.println("enter book title");
record.bookTitle=br.readLine();
System.out.println("enter author name");
record.bookAuthor=br.readLine();
//write to a file
fout.write(record.bookNo+"\t");
fout.write(record.bookTitle+"\t");
fout.write(record.bookAuthor+"\t");
}
fout.write("EOF");
fout.close();
break;
case 2:
FileWriter fw = new FileWriter("klu.txt");
FileReader fin1=new FileReader("bookdata.txt");
Scanner sc1=new Scanner(fin1);
while(sc1.hasNextInt())
{
record.bookNo=sc1.nextInt();
fw.write(record.bookNo+"\n");
record.bookTitle=sc1.next();
fw.write(record.bookTitle+"\n");
record.bookAuthor=sc1.next();
fw.write(record.bookAuthor+"\n");
}
System.out.println("enter then no of records");
num=Integer.parseInt(br.readLine());
for(i=0;i<num;i++){
System.out.println("enter book number");
record.bookNo=Integer.parseInt(br.readLine());
fw.write(record.bookNo+"\t");
System.out.println("enter book title");
record.bookTitle=br.readLine();
fw.write(record.bookTitle+"\t");
System.out.println("enter author name");
record.bookAuthor=br.readLine();
fw.write(record.bookAuthor+"\t");
}
fw.write("EOF");
fw.close();
FileWriter fout1 = new
FileWriter("bookdata.txt");
FileReader fin2=new FileReader("klu.txt");
Scanner sc2=new Scanner(fin2);
while(sc2.hasNextInt())
{
record.bookNo=sc2.nextInt();
fout1.write(record.bookNo+"\n");
record.bookTitle=sc2.next();
fout1.write(record.bookTitle+"\n");
record.bookAuthor=sc2.next();
fout1.write(record.bookAuthor+"\n");
}
fout1.write("EOF");
fout1.close();
break;
case 3:
System.out.println("enter book number");
searchBookNo=Integer.parseInt(br.readLine());
case 4:
FileReader fin=new FileReader("bookdata.txt");
Scanner sc=new Scanner(fin);
while(sc.hasNextInt())
{
record.bookNo=sc.nextInt();
record.bookTitle=sc.next();
record.bookAuthor=sc.next();
if(choice==4)
record.displayBooksRecord();
if(choice==3)
{
if(record.bookNo==searchBookNo)
record.displayBooksRecord();
}
}
str=sc.next();
if(str.equals("EOF"))
System.out.println("END OF FILE");
else
System.out.println("File format error");
break;
case 5:
break first;
}
}
MODULE2-
case 2:
System.out.println("BORROWERS INFORMATION");
BorrowerRec record1=new BorrowerRec();
second: while(true)
{
System.out.println("\nMENU\n");
System.out.println("1.create");
System.out.println("2.update");
System.out.println("3.search");
System.out.println("4.record");
System.out.println("5.exit\n");
System.out.println("enter user option");
choice=Integer.parseInt(br.readLine());
switch(choice)
{
case 1:
FileWriter fout=new FileWriter("borrowerinfo.txt");
System.out.println("How many records");
num=Integer.parseInt(br.readLine());
for(i=0;i<num;i++)
{
System.out.println("enter id number");
record1.regNo=Integer.parseInt(br.readLine());
System.out.println("enter name");
record1.name=br.readLine();
System.out.println("enter adress");
record1.adress=br.readLine();
fout.write(record1.regNo+"\n");
fout.write(record1.name+"\n");
fout.write(record1.adress+"\n");
}
fout.write("EOF");
fout.close();
break;
case 2:
FileWriter fw = new FileWriter("klu.txt");
FileReader fin1=new
FileReader("borrowerinfo.txt");
Scanner sc1=new Scanner(fin1);
while(sc1.hasNextInt())
{
record1.regNo=sc1.nextInt();
fw.write(record1.regNo+"\n");
record1.name=sc1.next();
fw.write(record1.name+"\n");
record1.adress=sc1.next();
fw.write(record1.adress+"\n");
}
System.out.println("enter then no of
records");
num=Integer.parseInt(br.readLine());
for(i=0;i<num;i++){
System.out.println("enter id number");
record1.regNo=Integer.parseInt(br.readLine());
fw.write(record1.regNo+"\t");
System.out.println("enter name");
record1.name=br.readLine();
fw.write(record1.name+"\t");
System.out.println("enter adress");
record1.adress=br.readLine();
fw.write(record1.adress+"\t");
}
fw.write("EOF");
fw.close();
FileWriter fout1 = new
FileWriter("borrowerinfo.txt");
FileReader fin2=new FileReader("klu.txt");
Scanner sc2=new Scanner(fin2);
while(sc2.hasNextInt())
{
record1.regNo=sc2.nextInt();
fout1.write(record1.regNo+"\n");
record1.name=sc2.next();
fout1.write(record1.name+"\n");
record1.adress=sc2.next();
fout1.write(record1.adress+"\n");
}
fout1.write("EOF");
fout1.close();
break;
case 3:
System.out.println("enter search id number");
searchRegNo=Integer.parseInt(br.readLine());
case 4:
FileReader fin=new
FileReader("borrowerinfo.txt");
Scanner sc=new Scanner(fin);
while(sc.hasNextInt())
{
record1.regNo=sc.nextInt();
record1.name=sc.next();
record1.adress=sc.next();
if(choice==4)
record1.displayBorrowerInfo();
if(choice==3)
{
if(record1.regNo==searchRegNo)
record1.displayBorrowerInfo();
}
}
str=sc.next();
if(str.equals("EOF"))
System.out.println("END OF FILE");
else
record4.adress=sc.next();
if(record4.regNo==searchRegNo){
record2.regNo=searchRegNo;
}
}
System.out.println("enter book number");
searchBookNo=Integer.parseInt(br.readLine());
FileReader fin1=new FileReader("bookdata.txt");
Scanner sc1=new Scanner(fin1);
while(sc1.hasNextInt())
{
record5.bookNo=sc1.nextInt();
record5.bookTitle=sc1.next();
record5.bookAuthor=sc1.next();
if(record5.bookNo==searchBookNo){
record2.bookNo=searchBookNo;
}
}
if(count==1){
FileWriter fout1=new FileWriter("issues.txt");
for(i=0;i<1;i++)
{
fout1.write(record2.regNo+"\n");
fout1.write(record2.bookNo+"\n");
fout1.write(record2.issueDate+"\n");
fout1.write(record2.returnDate+"\n");
}
fout1.write("EOF");
fout1.close();
}
else
{
FileWriter fout5 = new FileWriter("klume.txt");
FileReader fin4=new FileReader("issues.txt");
Scanner sc4=new Scanner(fin4);
DateFormat dateFormat1 = new
SimpleDateFormat("dd/MM/yyyy");
Calendar cal1 = Calendar.getInstance();
cal1.add(Calendar.DATE,14);
while(sc4.hasNextInt())
{
record6.regNo=sc4.nextInt();
fout5.write(record6.regNo+"\t");
record6.bookNo=sc4.nextInt();
fout5.write(record6.bookNo+"\t");
record6.issueDate=sc4.next();
fout5.write(record6.issueDate+"\t");
record6.returnDate=sc4.next();
fout5.write(record6.returnDate+"\t");
}
for(i=0;i<1;i++){
record6.regNo=searchRegNo;
fout5.write(record6.regNo+"\t");
record6.bookNo=searchBookNo;
fout5.write(record6.bookNo+"\t");
fout5.write(record6.issueDate+"\t");
record6.returnDate=dateFormat1.format(cal.getTime());
fout5.write(record6.returnDate+"\t");
}
fout5.write("EOF");
fout5.close();
FileWriter fout3 = new FileWriter("issues.txt");
FileReader fin5=new FileReader("klume.txt");
Scanner sc5=new Scanner(fin5);
while(sc5.hasNextInt())
{
record6.regNo=sc5.nextInt();
fout3.write(record6.regNo+"\n");
record6.bookNo=sc5.nextInt();
fout3.write(record6.bookNo+"\n");
record6.issueDate=sc5.next();
fout3.write(record6.issueDate+"\n");
record6.returnDate=sc5.next();
fout3.write(record6.returnDate+"\n");
}
fout3.write("EOF");
fout3.close();
}
break;
case 2:
IssueRecord record7=new IssueRecord();
ReturnRecord record8=new ReturnRecord();
FileWriter fout2=new FileWriter("returns.txt");
FileReader fin6=new FileReader("issues.txt");
Scanner sc6=new Scanner("fin6");
System.out.println("enter id nunmber");
searchRegNo=Integer.parseInt(br.readLine());
System.out.println("enter book number");
searchBookNo=Integer.parseInt(br.readLine());
while(sc6.hasNextInt())
{
record7.regNo=sc6.nextInt();
record7.bookNo=sc6.nextInt();
record7.issueDate=sc6.next();
record7.returnDate=sc6.next();
if(record7.bookNo==searchBookNo&&record7.regNo==searchRegNo){
record8.regNo=searchRegNo;
}
}
for(i=0;i<1;i++){
fout2.write(record8.regNo+"\t");
fout2.write(record8.returnDate);
}
fout2.write("EOF");
fout2.close();
break;
case 3:
System.out.println("enter search id number");
searchRegNo=Integer.parseInt(br.readLine());
case 4:
FileReader fin2=new FileReader("issues.txt");
Scanner sc2=new Scanner(fin2);
while(sc2.hasNextInt())
{
record2.regNo=sc2.nextInt();
record2.bookNo=sc2.nextInt();
record2.issueDate=sc2.next();
record2.returnDate=sc2.next();
if(choice==4)
record2.displayIssueRecord();
if(choice==3)
{
if(record2.regNo==searchRegNo)
record2.displayIssueRecord();
}
}
str=sc2.next();
if(str.equals("EOF"))
System.out.println("END OF FILE");
else
System.out.println("File format error");
break;
case 5:
int searchRecNo=0;
System.out.println("enter search id number");
searchRegNo=Integer.parseInt(br.readLine());
case 6:
FileReader fin3=new FileReader("returns.txt");
Scanner sc3=new Scanner(fin3);
while(sc3.hasNextInt())
{
record3.regNo=sc3.nextInt();
record3.returnDate=sc3.next();
if(choice==6)
record3.displayReturnRecord();
if(choice==5)
{
if(record3.regNo==searchRegNo)
record3.displayReturnRecord();
}
}
str=sc3.next();
if(str.equals("EOF"))
System.out.println("END OF FILE");
else
System.out.println("File format error");
break;
case 7:
break third;
}
}
break;
case 4:
flag=false;
break;
}
}
}
}
4. Results
All programs are compiled successfully. All programs are run and tested for correctness. Results
obtained are shown below
3.Search by Book Id
3. Generate Report
5.Quit
5.2 Future Scope: Some more functions or modules may be added to project. After studying
and understanding Graphic User Interface (GUI) of java, the inputs and outputs can be improved
and implemented using GUI.
6 Bibliography
1. Herbert Schildt, The Complete Reference Java2, 5th edition TMH, 2002.
2. Timothy A. Budd, An Introduction to Object-Oriented Programming, 3/E, Pearson,
2008.
3. Jim Keogh, The Complete Reference J2EE, TMH, 2006.
4. Deitel & Deitel, JAVA How to program, 6th edition, PHI, 2007.