0% found this document useful (0 votes)
287 views43 pages

Computer Science Project Final LIBRARY MANAGEMENT SYSTEM

LIBRARY MANAGEMENT SYSTEM http://freedownloadbcamcaproject.in/ this project can be submitted by BSE CS , B.Sc CS, BSIT or B.Sc IT, B.Tech IT or BE IT and MCA final year student as mini projects.

Uploaded by

arman.rose
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
287 views43 pages

Computer Science Project Final LIBRARY MANAGEMENT SYSTEM

LIBRARY MANAGEMENT SYSTEM http://freedownloadbcamcaproject.in/ this project can be submitted by BSE CS , B.Sc CS, BSIT or B.Sc IT, B.Tech IT or BE IT and MCA final year student as mini projects.

Uploaded by

arman.rose
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 43

LIBRARY MANAGEMENT

SYSTEM
Version 1.0 (2009-2010)

Computer Science Project

Delhi Public School, R.K.Puram, New Delhi

Index
Sno
1
2
3
4
5
6
7

Description
Certificate
Introduction
Source Code
Output Screen
Acknowledgements
Merits & Limitations
Hardware-Software Requirement

PageNo
3
4
5
24
40
41
42

Certificate
This is to certify that Library Management
System computer project is developed by
xxx
under my supervision in the computer lab of Delhi
Public School, R.K.Puram in the session 20092010. The work done by them is original.

Mrs. xxx
Computer Science Teacher
Date: ___________

Introduction
The project highlights the functioning of a Library
Management System.
Our original ideas include developing a menu based
system to enhance the quality of our project. It
stores related data like member details, book
details. It is meant to be operated by the person at
the reception/librarian. The program can be used to
effectively manage the various books present in a
library so that information about them can be easily
obtained. The user can easily enter information
about an entire library of books and retrieve it at
his/her own convenience using the various search
operations included in the program. The user can
also add names and other important information
about the members of the library which can also be
retrieved whenever required. There is also another
feature where the user can later add or delete the
existing record of books or members. The user can
also, using the program, find out which books have
been issued and to whom.
The project has been created with utmost intricacy
and it is hoped that it would prove to be useful in the
long run.
5

Free download mca final year


project Source C++ Code
/*
Program name
: <LIBRARY MANAGEMENT SYSTEM>
Version
: <1.0 (2009-2010)>
Filename
: <LIBPROJ.CPP>
Developers
: <Kapil Agarwal, Ishan Chawla, Neeraj Kumar>
School Name
: <DELHI PUBLIC SCHOOL, R.K.Puram, New Delhi>
*/
#include<fstream.h>
#include<conio.h>
#include<iomanip.h>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
const char TL=218,TR=191,BL=192,BR=217,HL=196,VL=179;
void DispCh(int C,int R,char Ch);
void AboutUs();
void ModifyTitle();
void ModifyAuthor();
void ModifyPrice();
void ModifyName();
void ModifyAdd();
void ModifyEmail();
void ModifyMob();
void DispCh(int C,int R,char Ch[]);
void Color(int TC,int TB);
void Recta(int C1,int R1,int C2,int R2);
int VMenu(int C,int R,char Men[][15],int Noo);
int HMenu(int C,int R,char Men[][15],int Noo);
void ShowB();
void ShowM();
void InsertB();
void InsertM();
void SearchBno();
int LastBno();
int LastMno();
void SearchTitle();
void SearchAuthor();
void SearchMno();
void SearchMob();
void SearchEmail();
void SearchName();
void DeleteB();
void DeleteM();
void Issue();
void Return();
void EditMBno(int imno,int ibno);
void EditBMno(int imno,int ibno);
void NIssueB();
void NIssueM();
void IssueB();

void IssueM();
//MAIN CLASS
class Book
{
int Bno;
char Title[50];
char Author[50];
int Price;
int Mno;
public:
Book() { Mno=0; }
void AddB(int );
void DisplayB();
int RBno() { return Bno; }
int RBMno() { return Mno; }
char* RTitle() { return Title; }
char* RAuthor() { return Author; }
void EditTitle() { cout<<"Title : "; gets(Title); }
void EditAuthor() { cout<<"Author : "; gets(Author); }
void EditPrice() { cout<<"Price : "; cin>>Price; }
void IssueBook(int TMno) { Mno=TMno; }
};
class Member
{
int Mno;
char Name[50];
char Add[80];
char Email[50];
char Mob[10];
int Bno;
public:
Member() { Bno=0; }
void AddM(int);
void DisplayM();
int RMno() { return Mno; }
int RMBno() { return Bno; }
char* RName() { return Name;}
char* REmail() { return Email;}
char* RMob() { return Mob;}
void EditName() { cout<<"Name : "; gets(Name); }
void EditAddress() { cout<<"Address : "; gets(Add); }
void EditMob() { cout<<"Mobile no : "; cin>>Mob; }
void EditEmail() { cout<<"E-mail : "; gets(Email); }
void Issue2Member(int TBno) { Bno=TBno; }
};
//Binary file Functions
void Book::AddB(int ibno)
{
Bno=ibno;
cout<<"Book No : "<<Bno<<endl;
cout<<"Title
: "; gets(Title);
cout<<"Author : "; gets(Author);
cout<<"Price
: "; cin>>Price;
}
void Book::DisplayB()

cout<<setw(10)<<Bno
<<setw(30)<<Title
<<setw(30)<<Author
<<setw(10)<<Price<<endl;

}
void Member::AddM(int imno)
{
Mno=imno;
cout<<"Member No : "<<Mno<<endl;
cout<<"Name
: "; gets(Name);
cout<<"Address
: "; gets(Add);
cout<<"E-Mail
: "; gets(Email);
cout<<"Mobile no : "; cin>>Mob;
}
void Member::DisplayM()
{
cout<<setw(4)<<Mno
<<setw(15)<<Name
<<setw(30)<<Add
<<setw(20)<<Email
<<setw(11)<<Mob<<endl;
}
void main()
{
clrscr();
Color(YELLOW,BLUE);
char S1Menu[][15]={"Add
",
"Display",
"Search ",
"Delete ",
"Modify ",
"Quit
"};
char S13Menu[][15]={"Bno
",
"Title ",
"Author ",
"Quit
"};
char S15Menu[][15]={"Title ",
"Author ",
"Price ",
"Quit
"};
char S23Menu[][15]={"Mno
",
"Name
",
"Mobile no",
"Email
",
"Quit
"};
char S25Menu[][15]={"Name
",
"Address ",
"Mobile no",
"E-mail
",
"Quit
"};
char S2Menu[][15]={"Add
",
"Display",
"Search ",
"Delete ",
"Modify ",
"Quit
"};

char S3Menu[][15]={"Issue ",


"Return",
"Quit "};
char S4Menu[][15]={"Books
",
"Members ",
"About Us",
"Quit
"};
char S41Menu[][15]={"Issued
",
"Non Issued",
"Quit
"};
char Menu[][15]={"Book
",
"Member ",
"Utility",
"Reports",
"Quit
"};
AboutUs();getch();
int Quit=0,N,SN,SN1;
do
{
clrscr();
//Display Main Menu1
N=HMenu(1,1,Menu,5),SN;
switch (N)
{
case 0:SN=VMenu(1,2,S1Menu,6);
switch(SN)
{
case 0:clrscr();InsertB();break;
case 1:clrscr();ShowB();break;
case 2:SN1=VMenu(9,4,S13Menu,4);
switch(SN1)
{
case 0:clrscr();SearchBno();break;
case 1:clrscr();SearchTitle();break;
case 2:clrscr();SearchAuthor();break;
}
break;
case 3:clrscr();DeleteB();break;
case 4:SN1=VMenu(9,6,S15Menu,4);
switch(SN1)
{
case 0:clrscr();ModifyTitle();break;
case 1:clrscr();ModifyAuthor();break;
case 2:clrscr();ModifyPrice();break;
}
}
getch();
break;
case 1:SN=VMenu(11,2,S2Menu,6);
switch(SN)
{
case 0:clrscr();InsertM();break;
case 1:clrscr();ShowM();break;
case 2:SN1=VMenu(19,4,S23Menu,5);
switch(SN1)
{
case 0:clrscr();SearchMno();break;

case 1:clrscr();SearchName();break;
case 2:clrscr();SearchMob();break;
case 3:clrscr();SearchEmail();break;

}
break;
case 3:clrscr();DeleteM();break;
case 4:SN1=VMenu(19,6,S25Menu,5);
switch(SN1)
{
case 0:clrscr();ModifyName();break;
case 1:clrscr();ModifyAdd();break;
case 2:clrscr();ModifyMob();break;
case 3:clrscr();ModifyEmail();break;
}
break;

}
getch();
break;
case 2:SN=VMenu(21,2,S3Menu,3);
switch(SN)
{
case 0:clrscr();Issue();break;
case 1:clrscr();Return();break;
}
getch();
break;
case 3:SN=VMenu(31,2,S4Menu,4);
switch(SN)
{
case 0:SN1=VMenu(40,2,S41Menu,3);
switch(SN1)
{
case 0:clrscr();IssueB();break;
case 1:clrscr();NIssueB();break;
}
break;
case 1:SN1=VMenu(40,3,S41Menu,3);
switch(SN1)
{
case 0:clrscr();IssueM();break;
case 1:clrscr();NIssueM();break;
}
break;
case 2:AboutUs();break;
}
getch();
break;
case 4:clrscr();
AboutUs();
Quit=1;
break;

}
}
while (!Quit);
getch();

//GENRAL FUNCTIONS
void DispCh(int C,int R,char Ch)
{
gotoxy(C,R);cprintf("%c",Ch);//C 1-80 R 1-25
}
void DispCh(int C,int R,char Ch[])
{
gotoxy(C,R);cprintf("%s",Ch);
}
void Color(int TC,int TB)
{
textcolor(TC);
textbackground(TB);
}
void Recta(int C1,int R1,int C2,int R2)
{
DispCh(C1,R1,TL);
DispCh(C2,R1,TR);
DispCh(C1,R2,BL);
DispCh(C2,R2,BR);
for (int i=C1+1;i<C2;i++)
{
DispCh(i,R1,HL);
DispCh(i,R2,HL);
}
for (i=R1+1;i<R2;i++)
{
DispCh(C1,i,VL);
DispCh(C2,i,VL);
}
}
int VMenu(int C,int R,char Men[][15],int Noo)
{
Color(YELLOW,BLUE);
Recta(C,R,C+strlen(Men[0])+1,R+Noo+1);//Drawing a rectangle enclosing
options
for (int i=0;i<Noo;i++)
DispCh(C+1,R+i+1,Men[i]);
//Displaying All options
int Exit=0,Sel=0;
do
{
int Tsel=Sel;
Color(BLUE,YELLOW);
//Changing color for highlighting
DispCh(C+1,R+Sel+1,Men[Sel]);//Redisplaying the selected option with
changed color
Color(YELLOW,BLUE);
//Changing color to normal
char Ch=getch();
//Accepting option from user
switch(Ch)
{
case 71:Sel=0;break;
//Home -> Move to first option
case 79:Sel=Noo-1;break;
//End -> Move to Last option
case 72:if (Sel==0)
//Up
-> Checking if already on top
Sel=Noo-1;
//
Move to the last option
else
//

Sel--;
//
Move one option up
break;
case 80:if (Sel==Noo-1)
//Down -> Checking if already at bottom
Sel=0;
//
Move to the first option
else
//
Sel++;
//
Move one step down
break;
case 27:Sel=-1;
//Escape-> Getting out of the Menu without valid
selection
case 13:Exit=1;
//Enter-> Getting out of the Menu with current
selection
}
DispCh(C+1,R+Tsel+1,Men[Tsel]);//Redisplaying the non-highlighted option
}
while (!Exit);
return Sel;
//Returning the selected value from menu
}
int HMenu(int C,int R,char Men[][15],int Noo)
{
int Exit=0,Sel=0;
Color(YELLOW,BLUE);
for (int i=0;i<Noo;i++)
DispCh(C+10*i+1,R,Men[i]);
do
{
int Tsel=Sel;
Color(BLUE,YELLOW);
DispCh(C+10*Sel+1,R,Men[Sel]);
Color(YELLOW,BLUE);
char Ch=getch();
switch(Ch)
{
case 71:Sel=0;break;
//Home
case 79:Sel=Noo-1;break; //End
case 75:if (Sel==0)
//Left
Sel=Noo-1;
else
Sel--;
break;
case 77:if (Sel==Noo-1) //Right
Sel=0;
else
Sel++;
break;
case 27:Sel=-1;
//Escape
case 13:Exit=1;
//Enter
}
DispCh(C+10*Tsel+1,R,Men[Tsel]);
}
while (!Exit);
return Sel;
}
void InsertB()
{
int NewBno=LastBno()+1;
fstream fil;
fil.open("Book.dat",ios::binary|ios::app);

Book S;
S.AddB(NewBno);
fil.write((char*)&S,sizeof(S));
fil.close();
}
void ShowB()
{
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
Book S;
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;
while(fil.read((char*)&S,sizeof(S)))
S.DisplayB();
fil.close();
}
void InsertM()
{
int NewMno=LastMno()+1;
fstream fil;
fil.open("Member.dat",ios::binary|ios::app);
Member S;
S.AddM(NewMno);
fil.write((char*)&S,sizeof(S));
fil.close();
}
void ShowM()
{
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
Member S;
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
while(fil.read((char*)&S,sizeof(S)))
S.DisplayM();
fil.close();
}
void SearchBno()
{
int sbno,found=0;
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
Book S;
cout<<"Book no : ";
cin>>sbno;
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(S.RBno()==sbno)
{
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"

<<setw(10)<<"PRICE"<<endl;
S.DisplayB();
found++;

}
}
if (found==0)
cout<<"Book Not Found"<<endl;
fil.close();

}
void SearchMno()
{
int smno,found=0;
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
Member S;
cout<<"Member no : ";
cin>>smno;
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(S.RMno()==smno)
{
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
S.DisplayM();
found++;
}
}
if (found==0)
cout<<"Member Not Found"<<endl;
fil.close();
}
void SearchTitle()
{
char stitle[50];
int found=0;
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
Book S;
cout<<"Book Title: ";
gets(stitle);
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(!strcmpi(S.RTitle(),stitle))
{
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;
S.DisplayB();
found++;
}
}
if (found==0)
cout<<"Book Not Found"<<endl;

fil.close();

void SearchAuthor()
{
char sauthor[50];
int found=0;
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
Book S;
cout<<"Author : ";
gets(sauthor);
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(!strcmpi(S.RAuthor(),sauthor))
{
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;
S.DisplayB();
found++;
}
}
if (found==0)
cout<<"Book Not Found"<<endl;
fil.close();
}
void DeleteB()
{
fstream fil1,fil2;
Book S;
int del=0,sbno;
fil1.open("Book.dat",ios::binary|ios::in);
fil2.open("Book1.dat",ios::binary|ios::out);
cout<<"Enter Book no : ";
cin>>sbno;
while(fil1.read((char*)&S,sizeof(S)))
{
if(S.RBno()!=sbno)
fil2.write((char*)&S,sizeof(S));
else
del++;
}
if(!del)
cout<<"Book not found"<<endl;
else
cout<<"Book deleted "<<endl;
fil1.close();
fil2.close();
remove("Book.dat");
rename("Book1.dat","Book.dat");
}
void DeleteM()
{
fstream fil1,fil2;
Member S;

int del=0,smno;
fil1.open("Member.dat",ios::binary|ios::in);
fil2.open("Member1.dat",ios::binary|ios::out);
cout<<"Enter Member no : ";
cin>>smno;
while(fil1.read((char*)&S,sizeof(S)))
{
if(S.RMno()!=smno)
fil2.write((char*)&S,sizeof(S));
else
del++;
}
if(!del)
cout<<"Member not found"<<endl;
else
cout<<"Member deleted "<<endl;
fil1.close();
fil2.close();
remove("Member.dat");
rename("Member1.dat","Member.dat");
}
void ModifyTitle()
{
fstream fil;
fil.open("Book.dat",ios::binary|ios::in|ios::out);
Book S;
int SBno,found=0;
cout<<"Enter Book no : "; cin>>SBno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RBno()==SBno)
found++;
if (found)
{
S.EditTitle();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
else
cout<<"Book Not Found"<<endl;
fil.close();
}
void ModifyAuthor()
{
fstream fil;
fil.open("Book.dat",ios::binary|ios::in|ios::out);
Book S;
int SBno,found=0;
cout<<"Enter Book no : "; cin>>SBno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RBno()==SBno)
found++;
if (found)
{
S.EditAuthor();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);

fil.write((char*)&S,sizeof(S));
}
else
cout<<"Book Not Found"<<endl;
fil.close();

}
void ModifyPrice()
{
fstream fil;
fil.open("Book.dat",ios::binary|ios::in|ios::out);
Book S;
int SBno,found=0;
cout<<"Enter Book no : "; cin>>SBno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RBno()==SBno)
found++;
if (found)
{
S.EditPrice();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
else
cout<<"Book Not Found"<<endl;
fil.close();
}
void SearchName()
{
char sname[50];
int found=0;
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
Member S;
cout<<"Member name : ";
gets(sname);
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(!strcmpi(S.RName(),sname))
{
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
S.DisplayM();
found++;
}
}
if (found==0)
cout<<"Member Not Found"<<endl;
fil.close();
}
void SearchMob()
{
char smob[10];
int found=0;

fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
Member S;
cout<<"Mobile no : ";
cin>>smob;
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(strcmpi(S.RMob(),smob)==0)
{
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
S.DisplayM();
found++;
}
}
if (found==0)
cout<<"Member Not Found"<<endl;
fil.close();

}
void SearchEmail()
{
char semail[50];
int found=0;
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
Member S;
cout<<"E-mail : ";
gets(semail);
while (fil.read((char*)&S,sizeof(S)) && (!found))
{
if(!strcmpi(S.REmail(),semail))
{
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
S.DisplayM();
found++;
}
}
if (found==0)
cout<<"Member Not Found"<<endl;
fil.close();
}
void ModifyName()
{
fstream fil;
fil.open("Member.dat",ios::binary|ios::in|ios::out);
Member S;
int SMno,found=0;
cout<<"Enter Member no : "; cin>>SMno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RMno()==SMno)

found++;
if (found)
{
S.EditName();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
else
cout<<"Member Not Found"<<endl;
fil.close();

}
void ModifyAdd()
{
fstream fil;
fil.open("Member.dat",ios::binary|ios::in|ios::out);
Member S;
int SMno,found=0;
cout<<"Enter Member no : "; cin>>SMno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RMno()==SMno)
found++;
if (found)
{
S.EditAddress();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
else
cout<<"Member Not Found"<<endl;
fil.close();
}
void ModifyMob()
{
fstream fil;
fil.open("Member.dat",ios::binary|ios::in|ios::out);
Member S;
int SMno,found=0;
cout<<"Enter Member no : "; cin>>SMno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RMno()==SMno)
found++;
if (found)
{
S.EditMob();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
else
cout<<"Member Not Found"<<endl;
fil.close();
}
void ModifyEmail()
{
fstream fil;

fil.open("Member.dat",ios::binary|ios::in|ios::out);
Member S;
int SMno,found=0;
cout<<"Enter Member no : "; cin>>SMno;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RMno()==SMno)
found++;
if (found)
{
S.EditEmail();
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
else
cout<<"Member Not Found"<<endl;
fil.close();

}
void Issue()
{
Member M;
Book B;
int imno,ibno,N,T,foundm=0,foundb=0,a=0;
char ch;
cout<<"Member no : ";
cin>>imno;
fstream fil1,fil2;
fil1.open("Member.dat",ios::binary|ios::in);
fil2.open("Book.dat",ios::binary|ios::in);
while (fil1.read((char*)&M,sizeof(M)) && !foundm)
{
if (imno==M.RMno())
{
foundm++;
if (!M.RMBno())
{
cout<<"Enter Book no : ";
cin>>ibno;
while (fil2.read((char*)&B,sizeof(B)) && foundb==0)
{
if (ibno==B.RBno())
{
foundb++;
if (!B.RBMno())
{
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;
B.DisplayB();
cout<<"Confirm book issued (Y/N) : ";
cin>>ch;
switch (ch)
{
case 'y':
case 'Y':cout<<"Book Issued"<<endl;
a++;

break;

}
else cout<<"Book already issued"<<endl;
}
}
if (!foundb)
cout<<"Not Available"<<endl;
}
else cout<<"Please return the book issued"<<endl;
}
}
if (!foundm)
cout<<"Member not found"<<endl;
fil2.close();
fil1.close();
if (a)
{
EditMBno(imno,ibno);
EditBMno(imno,ibno);
}

}
void Return()
{
Member M;
Book B;
int imno,ibno,N,T,foundm=0,foundb=0,a=0;
char ch;
cout<<"Enter Member no : ";
cin>>imno;
fstream fil1,fil2;
fil1.open("Member.dat",ios::binary|ios::in);
fil2.open("Book.dat",ios::binary|ios::in);
while (fil1.read((char*)&M,sizeof(M)) && !foundm)
{
if (imno==M.RMno())
{
foundm++;
if (M.RMBno())
{
ibno=M.RMBno();
while (fil2.read((char*)&B,sizeof(B)) && !foundb)
{
if (ibno==B.RBno())
{
foundb++;
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;
B.DisplayB();
cout<<"Confirm book returned (Y/N) : ";
cin>>ch;
switch (ch)
{
case 'y':
case 'Y':cout<<"Book Returned"<<endl;

a++;
break;
}

}
}
else cout<<"Book not issued"<<endl;

}
}
if (!foundm)
cout<<"Member not found"<<endl;
fil2.close();
fil1.close();
if (a)
{
EditMBno(imno,0);
EditBMno(0,ibno);
}

}
void EditMBno(int imno,int ibno)
{
fstream fil;
fil.open("Member.dat",ios::binary|ios::in|ios::out);
Member S;
int found=0;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RMno()==imno)
found++;
if (found)
{
S.Issue2Member(ibno);
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
fil.close();
}
void EditBMno(int imno,int ibno)
{
fstream fil;
fil.open("Book.dat",ios::binary|ios::in|ios::out);
Book S;
int found=0;
while(!found && fil.read((char*)&S,sizeof(S)))
if (S.RBno()==ibno)
found++;
if (found)
{
S.IssueBook(imno);
int N=fil.tellg()-sizeof(S);
fil.seekp(N);
fil.write((char*)&S,sizeof(S));
}
fil.close();
}
void IssueM()
{

Member M;
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
while(fil.read((char*)&M,sizeof(M)))
{
if (M.RMBno())
M.DisplayM();
}
fil.close();
}
void NIssueM()
{
Member M;
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
cout<<setw(4)<<"MNO"
<<setw(15)<<"NAME"
<<setw(30)<<"ADDRESS"
<<setw(20)<<"EMAIL"
<<setw(11)<<"MOBILE"<<endl;
while(fil.read((char*)&M,sizeof(M)))
{
if (!M.RMBno())
M.DisplayM();
}
fil.close();
}
void IssueB()
{
Book M;
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;
while(fil.read((char*)&M,sizeof(M)))
{
if (M.RBMno())
M.DisplayB();
}
fil.close();
}
void NIssueB()
{
Book M;
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
cout<<setw(10)<<"BOOK NO"
<<setw(30)<<"BOOK NAME"
<<setw(30)<<"AUTHOR"
<<setw(10)<<"PRICE"<<endl;

while(fil.read((char*)&M,sizeof(M)))
{
if (!M.RBMno())
M.DisplayB();
}
fil.close();
}
int LastMno()
{
fstream fil;
fil.open("Member.dat",ios::binary|ios::in);
Member M;
int LMno=100;
while(fil.read((char*)&M,sizeof(M)))
{
LMno=M.RMno();
}
fil.close();
return LMno;
}
int LastBno()
{
fstream fil;
fil.open("Book.dat",ios::binary|ios::in);
Book B;
int LBno=100;
while(fil.read((char*)&B,sizeof(B)))
{
LBno=B.RBno();
}
fil.close();
return LBno;
}
void AboutUs()
{
clrscr();
gotoxy(27,7);
cout<<"LIBRARY MANAGEMENT SYSTEM"<<endl;
gotoxy(27,9);
cout<<"VERSION 1.0 ( 2009-2010 )"<<endl;
gotoxy(27,11);
cout<<"COMPUTER SCIENCE PROJECT "<<endl;
gotoxy(33,14);
cout<<"Developed by : "<<endl;
gotoxy(33,16);
cout<<"Kapil Agarwal";
gotoxy(33,17);
cout<<"Ishan Chawla";
gotoxy(33,18);
cout<<"Neeraj Kumar";
gotoxy(19,21);
cout<<"DELHI PUBLIC SCHOOL, R. K. PURAM, NEW DELHI"<<endl;
}

Output Screens

Acknowledgements
We would like to thank our computer science
teachers Mrs. xxx and Mr. xxx who gave their
valuable opinions and suggestions and have been
instrumental in allowing this project to be
completed. Also, we would like to thank the lab
assistant who helped us whenever we faced
difficulties. Finally, we wish to thank our parents for
their love and encouragement, without whom we
would never have enjoyed so many opportunities.

Merits & Limitations


The project has a very basic functional design
which can easily accommodate smaller databases.
The entered records of books and members can be
displayed in a tabular manner, which enables the
user to see all the available details. The formatting
has to be precise and lengthy elaborations may
disrupt the tabular display.
Some features, however, enable the project to be
extremely user friendly. Any book can be searched
for among the many records at ones own
convenience. Book names, member details and other
details can be edited using the Modify feature. We
can also check which book has been issued. Only
those books will be issued which have not been
already issued. This makes our project more
comprehensive.

Hardware & Software


Requirement

Hardware Requirement
Pentium 3/4/Core 2 Duo/Dual core
With at least 256 MB RAM
2 MB free space on Hard Disk
Color Monitor/LCD

Operating System
MS Windows 98/XP/Vista
Turbo C++ 3.0 Compiler

You might also like