Library Management System
Library Management System
ENGLISH
2018
LIBRARY MANAGEMENT
SYSTEM PROJECT
Abstract
The project titled Library Management System is Library
management software for controlling the transaction in a library.
Now-a-days most of the schools and institutions have large libraries
and students frequently issue books, so librarians often find it
difficult to manage the process manually. The project “Library
Management System” is a windows application written for 32-bit
Windows operating systems and developed in Turbo C++ 3.0,
which mainly focuses on basic operations in a library like adding new
member, new books, and updating new information, searching
books, other details of books that are issued by a student and facility
to borrow and return books.
TABLE OF CONTENTS
SI.No Contents
1 Introduction
1.1 Requirements
1.2 Aims and Objectives
1.3 Problem Statement
1.4 Scope of project
2 Literature Review
2.1 Features
2.2 Why we need it
2.3 Task of Librarian
2.4 Task of Library staff
3 Methodology
3.1 Result
3.2 Discussion
3.3 Limitation
4 Data Analysis
5 Conclusion
6 Reference
1. INTRODUCTION Chapter#1
1.1 REQUIREMENTS
The Library Management System is needed to take care of data
regarding its users and books.
It stored database for students and books.
The student database stored information about a student’s ID
no, name.
The book database stored information about a book no, book
name, book author.
Issues Books
Return Books
METHODOLOGY Chapter#3
Now for displaying all books record press 2, we got the list of books
along with their details on screen.
For displaying specific book press 3 and entered number of that book
and then got the required information/records of that specific book
automatically.
For modifying the records of any of the book press 4 and then
entered book number. After entering book number we can change
anything about book e.g its author or its names. After
editing/modification your modified records had being saved
automatically.
For deleting book, press 5 and then entered Book number of that
particular book.
PROGRAM
IMPLEMENTATION
#include<fstream>
#include<conio.h>
#include<string.h>
#include<iomanip>
#include<iostream>
using namespace std;
class book
char book_number[30];
char book_name[50];
char author_name[20];
public:
void create_book()
cin>>book_number;
cin.ignore();
cin.getline(book_name,50);
cin.ignore();
cin.getline(author_name,50);
void show_book()
}
void modify_book()
cin.ignore();
cin.getline(book_name,50);
cin.ignore();
cin.getline(author_name,50);
char* getbooknumber()
return book_number;
void report()
{cout<<book_number<<setw(30)<<book_name<<setw(30)<<author_name<<endl;}
};
class student
char ID_number[20];
char Student_name[20];
char stbno[6];
int token;
public:
void create_student()
{
cout<<"\nEnter The ID Number ";
cin>>ID_number;
cin>>Student_name;
token=0;
stbno[0]='/0';
void show_student()
puts(Student_name);
if(token==1)
cout<<"\nBook No "<<stbno;
void modify_student()
cin.ignore();
cin.getline(Student_name,50);
char* get_ID_number()
{
return ID_number;
char* retstbno()
return stbno;
int rettoken()
return token;
void addtoken()
{token=1;}
void resettoken()
{token=0;}
strcpy(stbno,t);
void report()
{cout<<"\t"<<ID_number<<setw(20)<<Student_name<<setw(10)<<token<<endl;}
};
fstream fp,fp1;
book bk;
student st;
void write_book()
{
system("cls");
int more_or_main;
fp.open("book.dat",ios::out|ios::app);
do
bk.create_book();
fp.write((char*)&bk,sizeof(book));
cout<<"Enter: ";
cin>>more_or_main;
}while(more_or_main == 1);
fp.close();
void write_student()
system("cls");
int more_or_main;
fp.open("student.dat",ios::out|ios::app);
do
st.create_student();
fp.write((char*)&st,sizeof(student));
cout<<"Enter: ";
cin>>more_or_main;
}while(more_or_main == 1);
fp.close();
system("cls");
cout<<"\nBOOK DETAILS\n";
int check=0;
fp.open("book.dat",ios::in);
while(fp.read((char*)&bk,sizeof(book)))
if(strcmpi(bk.getbooknumber(),n)==0)
bk.show_book();
check=1;
fp.close();
if(check==0)
getch();
system("cls");
cout<<"\nSTUDENT DETAILS\n";
int check=0;
fp.open("student.dat",ios::in);
while(fp.read((char*)&st,sizeof(student)))
if((strcmpi(st.get_ID_number(),n)==0))
st.show_student();
check=1;
fp.close();
if(check==0)
getch();
void modify_book()
system("cls");
char n[20];
int found=0;
cout<<"\n\n\tMODIFY BOOK";
cin>>n;
fp.open("book.dat",ios::in|ios::out);
if(strcmpi(bk.getbooknumber(),n)==0)
bk.show_book();
bk.modify_book();
int pos=-1*sizeof(bk);
fp.seekp(pos,ios::cur);
fp.write((char*)&bk,sizeof(book));
found=1;
fp.close();
if(found==0)
getch();
void modify_student()
system("cls");
char n[20];
int found=0;
cin>>n;
fp.open("student.dat",ios::in|ios::out);
if(strcmpi(st.get_ID_number(),n)==0)
st.show_student();
st.modify_student();
int pos=-1*sizeof(st);
fp.seekp(pos,ios::cur);
fp.write((char*)&st,sizeof(student));
found=1;
fp.close();
if(found==0)
getch();
void delete_student()
system("cls");
char n[20];
int flag=0;
cout<<"\n\n\n\tDELETE STUDENT";
cout<<"\n\nEnter The ID number of the Student You Want To Delete: ";
cin>>n;
fp.open("student.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);
fp.seekg(0,ios::beg);
while(fp.read((char*)&st,sizeof(student)))
if(strcmpi(st.get_ID_number(),n)!=0)
fp2.write((char*)&st,sizeof(student));
else
flag=1;
fp2.close();
fp.close();
remove("student.dat");
rename("Temp.dat","student.dat");
if(flag==1)
else
getch();
void delete_book()
system("cls");
char n[20];
int flag=0;
cout<<"\n\n\n\tDELETE BOOK";
cin>>n;
fp.open("book.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);
fp.seekg(0,ios::beg);
while(fp.read((char*)&bk,sizeof(book)))
if(strcmpi(bk.getbooknumber(),n)!=0)
fp2.write((char*)&bk,sizeof(book));
else
flag=1;
fp2.close();
fp.close();
remove("book.dat");
rename("Temp.dat","book.dat");
if(flag==1)
else
void display_all_students()
system("cls");
fp.open("student.dat",ios::in);
if(!fp)
getch();
return;
cout<<"\n\n\t\tSTUDENT LIST\n\n";
cout<<"==================================================================\n";
cout<<"==================================================================\n";
while(fp.read((char*)&st,sizeof(student)))
st.report();
fp.close();
getch();
void display_allb()
{
system("cls");
fp.open("book.dat",ios::in);
if(!fp)
getch();
return;
cout<<"\n\n\t\tBook LIST\n\n";
cout<<"======================================================================
===\n";
cout<<"======================================================================
===\n";
while(fp.read((char*)&bk,sizeof(book)))
bk.report();
fp.close();
getch();
void issue_book()
system("cls");
char sn[20],bn[20];
int found=0,flag=0;
cout<<"\t\t\nBOOK ISSUE";
cin>>sn;
fp.open("student.dat",ios::in|ios::out);
fp1.open("book.dat",ios::in|ios::out);
if(strcmpi(st.get_ID_number(),sn)==0)
found=1;
if(st.rettoken()==0)
cin>>bn;
while(fp1.read((char*)&bk,sizeof(book))&& flag==0)
if(strcmpi(bk.getbooknumber(),bn)==0)
bk.show_book();
flag=1;
st.addtoken();
st.getstbno(bk.getbooknumber());
int pos=-1*sizeof(st);
fp.seekp(pos,ios::cur);
fp.write((char*)&st,sizeof(student));
if(flag==0)
else
if(found==0)
getch();
system("cls");
fp.close();
fp1.close();
void book_return()
system("cls");
char sn[20],bn[20];
cout<<"\t\tRETURN BOOKS\n";
cin>>sn;
fp.open("student.dat",ios::in|ios::out);
fp1.open("book.dat",ios::in|ios::out);
while(fp.read((char*)&st,sizeof(student)) && found==0)
if(strcmpi(st.get_ID_number(),sn)==0)
found=1;
if(st.rettoken()==1)
while(fp1.read((char*)&bk,sizeof(book))&& flag==0)
if(strcmpi(bk.getbooknumber(),st.retstbno())==0)
bk.show_book();
flag=1;
cin>>day;
if(day>15)
fine=(day-15)*1;
st.resettoken();
int pos=-1*sizeof(st);
fp.seekp(pos,ios::cur);
fp.write((char*)&st,sizeof(student));
}
}
if(flag==0)
else
if(found==0)
getch();
system("cls");
fp.close();
fp1.close();
void intro()
system("color 07");
system("cls");
cout<<"\t\t\t\t*\t*";
cout<<"\t\t\t\t**\t**";
cout<<"\t\t\t\t***\t***";
cout<<"\t\t\t\t****\t****";
cout<<"\t\t\t\t*****\t*****";
cout<<"\t\t\t\t******\t******";
cout<<"\t\t\t\t*******\t*******";
cout<<"\t\t\t\t*******\t*******";
cout<<"\t\t\t\t******\t******";
cout<<"\t\t\t\t*****\t*****";
cout<<"\t\t\t\t****\t****";
cout<<"\t\t\t\t***\t***";
cout<<"\t\t\t\t**\t**";
cout<<"\t\t\t\t*\t*";
void book_menu()
int option;
cout<<"\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@";
cout<<"\n\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@\n";
cout<<"\n\t\tOption: ";
cin>>option;
switch(option)
case 1: system("cls");
write_book();
break;
case 2: display_allb();
break;
case 3:
char num[20];
system("cls");
cin>>num;
display_a_book(num);
break;
case 4: modify_book();break;
case 5: delete_book();break;
case 6: system("cls");
break;
default:cout<<"\a";
void student_menu()
int option;
cout<<"\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@";
cout<<"\n\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@\n";
cout<<"\n\t\tOption: ";
cin>>option;
switch(option)
case 1: system("cls");
write_student();
break;
case 2: system("cls");
display_all_students();
break;
case 3:
char num[20];
system("cls");
cin>>num;
display_a_student(num);
break;
case 4:system("cls");
modify_student();break;
case 5: system("cls");
delete_student();break;
case 6:
break;
default:cout<<"\a";
int main()
int option = 0;
for(;;)
intro();
cout<<"\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@";
cout<<"\n\t\tPress 5 to TO EXIT";
cout<<"\n\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@\n";
cout<<"\n\t\tOption: ";
cin>>option;
switch(option)
case 1:system("cls");
issue_book();
break;
case 2:system("cls");
book_return();
break;
case 3:system("cls");
student_menu();
break;
case 4:system("cls");
book_menu();
break;
case 5:exit(0);
break;
default :cout<<"\a";
exit(0);
}
CONCLUSION
The project LIBRARY MANAGEMENT SYSTEM is for
computerizing the work in a library. This System allows the
user to store book details and the student details. This
software takes care of all the needs of a library and is capable
to provide easy and effective storage of information
associated with books and user. The implementation of this
software in organization is to reduce data entry, time and
also provide readily calculated reports. This was an effort to
develop a simple Library Management System which can be
helpful in a Library to insert, store, handle and retrieve
information about books and students.
REFRENCE
http://sigir.org/files/museum/pub-30/15.pdf