Professional Documents
Culture Documents
ON
“ LIBRARY MANAGEMENT”
SUBMITTED FOR PARTIAL
FULLFILMENT OF
PGDCA
OF
BILASPUR UNIVERSITY
BILASPUR (CG)
SESSION 2019-20
TOPIC
1. Acknowledgement
2. About Project
3. About C++
4. Preface
6. File Structure
7. Source Code
8. Input Form
9. Output Form
10. Bibliography
Acknowledgement
First and foremost, I thank Almighty God for all His blessings
showered on me.
We wish & express our heart full gratitude to the project guide Mr. AMIT
LAHRE the guidance and suggestions throughout the project, without which I
would not have been able to complete this project successfully.
About C++
The need of this system arises from error prone results and
need to save the time.
General Information
INITIAL.DAT
DFD FOR TRANSACTION OF BOOKS
ISSUE OF BOOKS
OPERATOR OUTPUT
ISSUEBOOK.DAT TEMP.DAT
EDIT MEMBER
OPERATOR DATA INITIAL.DAT
INITIAL.DAT TEMP.DAT
DFD FOR EDITING THE ACCOUNT OF BOOK
EDIT BOOK
OPERATOR DATA INITIAL.DAT
INITIAL.DAT TEMP.DAT
DELETE
OPERATOR MEMBER
INITIAL.DAT MEMBER.DAT
File Structure
INITIAL.DAT TABLE
In the INITIAL.DAT FILE details of the MEMBERS are stored during
the opening of New Account in the LIBRARY in this file his Name,
Address, Caution Money are stored.
BOOK.DAT TABLE
In the BOOK.DAT FILE details of the books are stored.
ISSUE.DAT TABLE
In the ISSUE.DAT FILE content of issued Book.
Source Code
LIBRARY.CPP
#include<graphics.h>
#include<dos.h>
#include <math.h>
#include "mainmenu.cpp"
void main()
{
int gd=DETECT,gm,i;
initgraph(&gd,&gm," ");
setcolor(2);
settextstyle(1,0,4);
outtextxy(200,50,"PROJECT REPORT");
setcolor(4);
delay(100);
settextstyle(1,0,4);
outtextxy(300,100,"ON");
delay(1000);
setcolor(9);
settextstyle(1,0,4);
outtextxy(150,150,"LIBRARY MANAGEMENT");
delay(1000);
setcolor(10);
settextstyle(1,0,3);
outtextxy(350,250,"DEVELOPED BY:");
delay(1000);
setcolor(12);
settextstyle(1,0,2);
outtextxy(350,300," ");
settextstyle(1,0,2);
outtextxy(350,350," ");
delay(1000);
setcolor(13);
settextstyle(1,0,2);
outtextxy(350,330,"");
delay(1000);
setcolor(14);
settextstyle(1,0,2);
outtextxy(400,380," ");
delay(1000);
setcolor(15);
settextstyle(1,0,2);
outtextxy(400,390,"");
getch();
cleardevice();
setbkcolor(14);
settextstyle(3,0,1);
for(i=0;i<=400;i++)
{
setcolor(RED);
circle(320,240,i);
sound(500);
delay(10);
}
nosound();
for(i=400;i>=0;i--)
{
setcolor(BLUE);
circle(320,240,i);
delay(10);
}
delay(1000);
getch();
closegraph();
mainmenu();
}
MAINMENU.CPP
#include <conio.h>
#include <iostream.h>
#include <stdlib.h>
#include "memmenu.cpp"
#include "bookmenu.cpp"
#include "issuemen.cpp"
char x[4][22]={"MEMBERS DETAILS " ,"BOOK DETAILS ",
"BOOK ISSUE ", "TO EXIT"};
int r=10,c=30;
void printmenu();
void mainmenu()
{
int i=0;
int r=10,c=30;
char ch;
textcolor(15);
textbackground(BLUE);
clrscr();
printmenu();
do
{
ch=getch();
switch(ch)
{
case 80:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i<3)
{
i++;r++;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 72:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i>0)
{
i--;r--;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 13:
if (i==0)
{
textbackground(9);
clrscr();
memmenu();
textbackground(9);
clrscr();
printmenu();
i=0;
}
else if (i==1)
{
textbackground(9);
clrscr();
bookmenu();
textbackground(9);
clrscr();
printmenu();
i=0;
r=10;
}
else if (i==2)
{
textbackground(9);
clrscr();
issuemenu();
textbackground(9);
clrscr();
printmenu();
i=0;
r=10;
}
if(i==3)
exit(1);
}
}while(1);
}
void printmenu()
{
int i;
int x1=25,y1=9,x2=50,y2=15;
textcolor(15);
textbackground(9);
for(i=x1;i<=x2;i++)
{
gotoxy(i,y1);
cout<<char(205);
}
for(i=x1;i<=x2;i++)
{
gotoxy(i,y2);
cout<<char(205);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x1,i);
cout<<char(186);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x2,i);
cout<<char(186);
}
gotoxy(x2,y1);
cout<<char(187);
gotoxy(x1,y1);
cout<<char(201);
gotoxy(x2,y2);
cout<<char(188);
gotoxy(x1,y2);
cout<<char(200);
gotoxy(x1+5,y1-3);
cout<<"LIBRARY MANAGEMENT";
for(i=0;i<=3;i++)
{
gotoxy(c,r);
cprintf("%s",x[i]);
r++;
}
i=0;r=10;
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
}
memmenu.cpp
#include <conio.h>
#include <iostream.h>
#include <fstream.h>
#include <stdio.h>
class member
{
private:
int memberid,deposit,id;
char name[20],address[10];
fstream file;
public:
void addmember();
void delmember();
void listmember();
}m;
void printmenu1();
void memmenu()
{
int i=0;
char x[4][20]={"TO ADD NEW MEMBER" ,"TO DELETE MEMBER","TO LIST
MEMBER","TO EXIT"};
int r=10,c=30;
char ch;
textcolor(15);
textbackground(BLUE);
clrscr();
printmenu1();
do
{
ch=getch();
switch(ch)
{
case 80:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i<3)
{
i++;r++;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 72:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i>0)
{
i--;r--;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 13:
if (i==0)
{
textbackground(9);
clrscr();
m.addmember();
clrscr();
printmenu1();
}
else if (i==1)
{
textbackground(9);
clrscr();
m.delmember();
clrscr();
printmenu1();
}
else if(i==2)
{
textbackground(9);
clrscr();
m.listmember();
clrscr();
printmenu1();
}
else if(i==3)
return;
i=0;
r=10;
}
}while(1);
}
void printmenu1()
{
int i=0;
char x[4][20]={"TO ADD NEW MEMBER" ,"TO DELETE MEMBER","TO LIST
MEMBER","TO EXIT"};
int r=10,c=30;
int x1=25,y1=9,x2=50,y2=15;
for(i=x1;i<=x2;i++)
{
gotoxy(i,y1);
cout<<char(205);
}
for(i=x1;i<=x2;i++)
{
gotoxy(i,y2);
cout<<char(205);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x1,i);
cout<<char(186);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x2,i);
cout<<char(186);
}
gotoxy(x2,y1);
cout<<char(187);
gotoxy(x1,y1);
cout<<char(201);
gotoxy(x2,y2);
cout<<char(188);
gotoxy(x1,y2);
cout<<char(200);
gotoxy(x1+5,y1-3);
cout<<"MEMBER MENU";
for(i=0;i<=3;i++)
{
gotoxy(c,r);
cprintf("%s",x[i]);
r++;
}
i=0;r=10;
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
}
void member::addmember()
{
file.open("member.dat",ios::app);
cout<<"enter memberid, name,address,deposit money";
cin>>memberid>>name>>address>>deposit;
file<<"\n"<<memberid<<"\t"<<name<<"\t"<<address<<"\t"<<deposit;
file.close();
gotoxy(10,22);
textbackground(2);
textcolor(4+128);
cprintf("Recode added successfuly");
textcolor(15);
textbackground(9);
getch();
}
void member::delmember()
{
fstream f1;
file.open("member.dat",ios::in);
f1.open("temp.dat",ios::out);
cout<<"enter memberid";
cin>>id;
do
{
file>>memberid>>name>>address>>deposit;
if(memberid!=id)
{
f1<<"\n"<<memberid<<"\t"<<name<<"\t"<<address<<"\t"<<deposit;
}
}while(file);
file.close();
f1.close();
remove("member.dat");
rename("temp.dat","member.dat");
gotoxy(10,22);
textbackground(2);
textcolor(4+128);
cprintf("Recode deleted successfuly");
textcolor(15);
textbackground(9);
getch();
}
void member::listmember()
{
file.open("member.dat",ios::in);
cout<<"\nmemberid\tname\taddress\t\tdeposit";
do
{
file>>memberid>>name>>address>>deposit;
if(!file.eof())
cout<<"\n"<<memberid<<" \t"<<name<<" \t"<<address<<"\t"<<deposit;
}while(!file.eof());
file.close();
getch();
}
bookmenu.cpp
#include <conio.h>
#include <iostream.h>
class book
{
private:
int bookid,price,id;
char name[20],authors[10];
//fstream file;
public:
void addbook();
void delbook();
void listbook();
}b;
void printmenu2();
void bookmenu()
{
int i=0;
char x[4][20]={"TO ADD NEW BOOK" ,"TO DELETE BOOK","TO LIST BOOK","TO EXIT"};
int r=10,c=30;
char ch;
textcolor(15);
textbackground(BLUE);
clrscr();
printmenu2();
do
{
ch=getch();
switch(ch)
{
case 80:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i<3)
{
i++;r++;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 72:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i>0)
{
i--;r--;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 13:
if (i==0)
{
textbackground(9);
clrscr();
b.addbook();
clrscr();
printmenu2();
}
else if (i==1)
{
textbackground(9);
clrscr();
b.delbook();
clrscr();
printmenu2();
}
else if(i==2)
{
textbackground(9);
clrscr();
b.listbook();
clrscr();
printmenu2();
}
else if(i==3)
return;
i=0;
r=10;
}
}while(1);
}
void printmenu2()
{
int i=0;
char x[4][20]={"TO ADD NEW BOOK" ,"TO DELETE BOOK","TO LIST BOOK","TO EXIT"};
int r=10,c=30;
int x1=25,y1=9,x2=50,y2=15;
for(i=x1;i<=x2;i++)
{
gotoxy(i,y1);
cout<<char(205);
}
for(i=x1;i<=x2;i++)
{
gotoxy(i,y2);
cout<<char(205);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x1,i);
cout<<char(186);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x2,i);
cout<<char(186);
}
gotoxy(x2,y1);
cout<<char(187);
gotoxy(x1,y1);
cout<<char(201);
gotoxy(x2,y2);
cout<<char(188);
gotoxy(x1,y2);
cout<<char(200);
gotoxy(x1+5,y1-3);
cout<<"BOOK MENU";
for(i=0;i<=3;i++)
{
gotoxy(c,r);
cprintf("%s",x[i]);
r++;
}
i=0;r=10;
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
}
void book::addbook()
cprintf("Record deleted successfuly");
textcolor(15);
textbackground(9);
getch();
}
void book::listbook()
{
fstream file;
file.open("book.dat",ios::in);
cout<<"\nbookid\tname\tauthors\t\tprice";
while(!file.eof())
{
file>>bookid>>name>>authors>>price;
if(!file.eof())
cout<<"\n"<<bookid<<"\t"<<name<<"\t"<<authors<<"\t"<<price;
}
file.close();
getch();
}
issuemen.cpp
#include <conio.h>
#include <iostream.h>
class issue
{
private:
int bookid,memberid,id;
char bookname[20],date[20];
fstream file;
public:
void issuebook();
void returnbook();
void listibook();
}m1;
void printmenu3();
void issuemenu()
{
int i=0;
char x[4][20]={"TO ISSUE BOOK" ,"TO RETURN BOOK","TO LIST ISSUED BOOK","TO
EXIT"};
int r=10,c=30;
char ch;
textcolor(15);
textbackground(BLUE);
clrscr();
printmenu3();
do
{
ch=getch();
switch(ch)
{
case 80:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i<3)
{
i++;r++;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 72:
textbackground(BLUE);
gotoxy(c,r);
cprintf("%s",x[i]);
if(i>0)
{
i--;r--;
}
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
break;
case 13:
if (i==0)
{
textbackground(9);
clrscr();
m1.issuebook();
clrscr();
printmenu3();
}
else if (i==1)
{
textbackground(9);
clrscr();
m1.returnbook();
clrscr();
printmenu3();
}
else if(i==2)
{
textbackground(9);
clrscr();
m1.listibook();
clrscr();
printmenu3();
}
else if(i==3)
return;
i=0;
r=10;
}
}while(1);
}
void printmenu3()
{
int i=0;
char x[4][20]={"TO ISSUE BOOK" ,"TO RETURN BOOK","TO LIST ISSUED BOOK","TO
EXIT"};
int r=10,c=30;
int x1=25,y1=9,x2=50,y2=15;
for(i=x1;i<=x2;i++)
{
gotoxy(i,y1);
cout<<char(205);
}
for(i=x1;i<=x2;i++)
{
gotoxy(i,y2);
cout<<char(205);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x1,i);
cout<<char(186);
}
for(i=y1+1;i<=y2-1;i++)
{
gotoxy(x2,i);
cout<<char(186);
}
gotoxy(x2,y1);
cout<<char(187);
gotoxy(x1,y1);
cout<<char(201);
gotoxy(x2,y2);
cout<<char(188);
gotoxy(x1,y2);
cout<<char(200);
gotoxy(x1+5,y1-3);
cout<<"BOOK ISSUE MENU";
for(i=0;i<=3;i++)
{
gotoxy(c,r);
cprintf("%s",x[i]);
r++;
}
i=0;r=10;
textbackground(RED);
gotoxy(c,r);
cprintf("%s",x[i]);
}
void issue::issuebook()
{
file.open("issue.dat",ios::app);
cout<<"enter bookid, memberid,bookname,date";
cin>>bookid>>memberid>>bookname>>date;
file<<"\n"<<bookid<<"\t"<<memberid<<"\t"<<bookname<<"\t"<<date;
file.close();
gotoxy(10,22);
textbackground(2);
textcolor(4+128);
cprintf("Record added successfuly");
textcolor(15);
textbackground(9);
getch();
}
void issue::returnbook()
{
fstream f1;
file.open("issue.dat",ios::in);
f1.open("temp.dat",ios::out);
cout<<"enter bookid";
cin>>id;
do
{
file>>bookid>>memberid>>bookname>>date;
if(bookid!=id)
{
f1<<"\n"<<bookid<<"\t"<<memberid<<"\t"<<bookname<<"\t"<<date;
}
}while(!file.eof());
file.close();
f1.close();
remove("issue.dat");
rename("temp.dat","issue.dat");
gotoxy(10,22);
textbackground(2);
textcolor(4+128);
cprintf("Record deleted successfuly");
textcolor(15);
textbackground(9);
getch();
}
void issue::listibook()
{
file.open("issue.dat",ios::in);
cout<<"\nbookid\tmemberid\tbookname\t\tdate";
do
{
file>>bookid>>memberid>>bookname>>date;
cout<<"\n"<<bookid<<"\t"<<memberid<<"\t"<<bookname<<"\t"<<date;
}while(!file.eof());
file.close();
getch();
Input Form
Output Form
BIBLIOGRAPHY
The following books and manuals provided a lot of help to us in making this project a
reality.
C++ COMPLETE REFERENCE
HERBERT SCHILDT
HOW TO PROGRAM C++
DEITERL & DEITEL
C++ PROGRAMMING
O’RELLY
SOFTWARE ENGINEERING
R. E. FAIRELY
SOFTWARE ENGINEERING
PRESSMAN
AN INTEGRATED APPROACH TO SOFTWARE
ENGINNERING
PANKAJ JALOTE
NAROSA PUBLISING HOUSE
SYSTEM ANALYSIS AND DESIGN
ELIAS M AWAD
GALGOTIA
C++ Programming
Yaswant Kanetkar