Académique Documents
Professionnel Documents
Culture Documents
Ms Komal
Submitted to :- MS KOMAL
ACKNOWLEDGEMENT
We are extremely grateful and remain indebted to our guide Ms Komal
for being a source of inspiration and for his constant support in the Design,
Implementation and Evaluation of the project. We are thankful to her for the
constant constructive criticism and invaluable suggestions, which benefited us a lot
while developing the project on “LIBRARY MANAGEMENT”. She has been a
constant source of inspiration and motivation for hard work. She has been very co-
operative throughout this project work. Through this column, it would be our
utmost pleasure to express our warm thanks to her for their encouragement, co-
operation and consent without which we mightn’t be able to accomplish this
project.
SAHIL SALGOTRA
PREFACE
This project of “ LIBRARY MANAGEMENT” gives us the complete information
about the library. We can enter the record of new books and retrieve the details of books
available in the library. We can issue the books to the students and maintain their records and can
also check how many books are issued and stock available in the library. In this project we can
maintain the late fine of students who returns the issued books after the due date.
Throughout the project the focus has been on presenting information and comments in
an easy and intelligible manner. The project is very useful for those who want to know about
Library Management System.
PROCESS DESCRIPTION
The Library Management System is designed & developed for a receipt and issuance of
books in the library along with the student’s details. The books received in the library are entered
in Books Entry form and the new student is entered in the student entry form. When the student
wants to get the desired book the same is issued on the availability basis to the student. The
issuance and due date for the returning of the book is also entered into the Book Issue form under
third menu Book Issue. The student has to pay the fine if any on the basis of no. of days delayed
deposit of the book in the library.
Program
import java.io.*;
import java.util.Vector;
class Book
String name,author,id;
float price;
byte total_copies,issued;
public Book()
name=null;
author=null;
id=null;
total_copies=issued=0;
name=a;
author=b;
id=c;
price=d;
total_copies=e;
class Member
String name=null,id=null;
Transaction t;
Book issued;
float fine=0.0f;
issued=null;
t=new Transaction();
name=a;
id=b;
}
}
class Transaction
byte day_of_issue,month_of_issue;
byte day_of_return,month_of_return;
short year_of_issue,year_of_return;
float fine=0.0f;
public Transaction()
day_of_issue=month_of_issue=1;
year_of_issue=2010;
day_of_return=month_of_return=1;
year_of_return=2010;
day_of_issue=Byte.parseByte(b.readLine());
month_of_issue=Byte.parseByte(b.readLine());
year_of_issue=Short.parseShort(b.readLine());
day_of_return=Byte.parseByte(b.readLine());
month_of_return=Byte.parseByte(b.readLine());
year_of_return=Short.parseShort(b.readLine());
byte i;
short days=0;
if(year_of_issue==year_of_return)
if(month_of_issue==month_of_return)
days=(short)(day_of_return-day_of_issue);
else
days+=calc_no_of_days(month_of_issue,year_of_issue)-day_of_issue;
for(i=(byte)(month_of_issue+1);i<month_of_return;i++)
days+=calc_no_of_days(i,year_of_issue);
}
days+=day_of_return;
else
days+=calc_no_of_days(month_of_issue,year_of_issue)-day_of_issue;
for(i=(byte)(month_of_issue+1);i<=12;i++)
days+=calc_no_of_days(i,year_of_issue);
for(i=1;i<month_of_return;i++)
days+=calc_no_of_days(i,year_of_return);
days+=day_of_return;
return days;
short d=0;
switch(month)
else d=28;
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:d=31;
case 4:
case 6:
case 9:
case 11:d=30;
return d;
class Library
Vector books,members;
Object[] x,y;
public Library()
books=new Vector();
members=new Vector();
update();
{
return x;
x=new Object[books.size()];
books.copyInto(x);
y=new Object[members.size()];
members.copyInto(y);
Book b=((Book)x[find_book(name,author)]);
if(r.equalsIgnoreCase("y"))
m.t.fine+=b.price;
b.total_copies--;
b.issued--;
books.setElementAt(b,find_book(name,author));
else if(m.t.calc_days()>7)
m.t.fine+= (m.t.calc_days())*(2.0f);
{
boolean flag=true;
if(x.length>0)
int i=0;
flag=false;
else
i++;
if(!flag)
return i;
else
return -1;
else
return -1;
{
Book b=((Book)x[pos_book]);
b.total_copies--;
b.issued++;
books.setElementAt(b,pos_book);
Member m=(Member)y[pos_mem];
m.issued=null;
members.setElementAt(m,pos_mem);
update();
Book b=((Book)x[pos_book]);
b.total_copies++;
b.issued--;
books.setElementAt(b,pos_book);
Member m=(Member)y[pos_mem];
m.issued=b;
members.setElementAt(m,pos_mem);
update();
boolean flag=true;
if(x.length>0)
{
int i=0;
flag=false;
else
i++;
if(!flag)
return i;
else
return -1;
else
return -1;
boolean flag=true;
if(y.length>0)
{
int i=0;
if(id.equals(((Member)y[i]).id))
flag=false;
else
i++;
if(!flag)
return i;
else
return -1;
else
return -1;
String name=b.readLine();
String author=b.readLine();
String id=b.readLine();
if(find_book(name,author,id)!=-1)
else
float pr=Float.parseFloat(b.readLine());
byte cop=Byte.parseByte(b.readLine());
books.addElement(new Book(name,author,id,pr,cop));
System.out.println("Added");
update();
String author=b.readLine();
if(find_book(name,author)!=-1)
books.removeElementAt(find_book(name,author));
System.out.println("Deleted.");
else
update();
String name=b.readLine();
String id=b.readLine();
if(find_member(id)!=-1)
}
else
members.addElement(new Member(name,id));
System.out.println("Added");
update();
String id=b.readLine();
if(find_member(id)!=-1)
members.removeElementAt(find_member(id));
System.out.println("Terminated");
else
update();
String id=b.readLine();
if(find_member(id)==-1)
else
String name=b.readLine();
String author=b.readLine();
if(find_book(name,author)==-1 ||
((Book)x[find_book(name,author)]).total_copies==2)
else if(((Member)y[find_member(id)]).issued!=null)
else
decrement(find_book(name,author),find_member(id));
Member m=(Member)y[find_member(id)];
m.t.issue_date();
members.setElementAt(m,find_member(id));
update();
String name=b.readLine();
String author=b.readLine();
String id=b.readLine();
Member m=(Member)y[find_member(id)];
String r=b.readLine();
if(r.equalsIgnoreCase("y"))
calc_fine(name,author,r,m);
members.setElementAt(m,find_member(id));
else
{
m.t.return_date();
calc_fine(name,author,r,m);
members.setElementAt(m,find_member(id));
increment(find_book(name,author),find_member(id));
update();
String id=b.readLine();
if(find_member(id)!=-1)
Member m=(Member)y[find_member(id)];
m.t.fine-=Float.parseFloat(b.readLine());
m.issued=null;
members.setElementAt(m,find_member(id));
update();
else
class Lib
String resp;
do
System.out.println();
System.out.println("7.ACCEPT FINE");
switch(Byte.parseByte(b.readLine()))
case 1:l.add_book();
break;
case 2:l.delete_book();
break;
case 3:l.add_member();
break;
case 4:l.delete_member();
break;
case 5:l.issue();
break;
case 6:l.return_book();
break;
case 7:l.receive_fine();
break;
default:System.out.println("Invalid choice");
break;
System.out.println();
resp=b.readLine();
}while(resp.equalsIgnoreCase("y"));
/*
OUTPUT:
What do you want to do?
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
Added
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
1
Added
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
Added
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
1
Added
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
Deleted.
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
Added
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
Added
Want to do any more operations?y
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
Added
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
4
Terminated
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE
1.ADD A BOOK
2.DELETE A BOOK
3.ADD A MEMBER
4.TERMINATE A MEMBER
5.ISSUE A BOOK
6.RETURN A BOOK
7.ACCEPT FINE