0% found this document useful (0 votes)
109 views34 pages

Submitted By: Submitted To: Sahil Singh Naveen Agrawal

This document contains source code for a C++ library management system project. It includes functions for adding, modifying, deleting, and searching book and student data, as well as functions for issuing books to students and viewing issued books. The code includes structs to store book and student data, header files, and a main menu function to allow users to select different library management tasks.

Uploaded by

Yash Gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views34 pages

Submitted By: Submitted To: Sahil Singh Naveen Agrawal

This document contains source code for a C++ library management system project. It includes functions for adding, modifying, deleting, and searching book and student data, as well as functions for issuing books to students and viewing issued books. The code includes structs to store book and student data, header files, and a main menu function to allow users to select different library management tasks.

Uploaded by

Yash Gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

SUBMITTED BY: SUBMITTED TO:

SAHIL SINGH NAVEEN AGRAWAL


CERTIFICATE

THIS IS TO CERTIFY THAT “SAHIL SINGH”


OF CLASS XI HAS SUCCESSFULLY
COMPLETED HIS PROJECT ”COMPUTER
SCIENCE PRACTICAL REPORT FILE”
DURING ACADEMICS SESSION 2018-2019
AS PER GUIDELINES ISSUED BY CBSE.
TEACHER’S SIGNATURE:
ACKNOWLEDGEMENT
The success and final outcome of this project
required a lot of guidance and assistance from many
people and I am extremely fortunate to have got this
all along the completions of my project work.
Whatever I have done is only due to such guidance
and assistance and I would not forget to thank them I
have taken efforts in this project. However, it would
not have been possible without the kind support and
help of many individuals. I would like to extend my
sincere thanks to all of them. I am highly indebted to my
computer teacher Mr. NAVEEN AGRAWAL for his guidance
and constant supervision as well as for providing
necessary information regarding the project & also for
supporting me in completing this project. I also thank our
respected Principal Mrs. VINAY SHARMA and Vice
Principal Mr. NATWAR CHAUDHARY for their support. I
am thankful to and fortunate enough to get
constant encouragement, support and guidance from
all teaching staff of Department of computer science
which helped us in successfully completing this project I
would like to express my gratitude towards my parents
for their kind co-operation and encouragement which
help me in completion of this project. My thanks and
appreciations also go to my colleague in developing
the project and people who have willingly helped me
out with their abilities.
OVERVIEW OF C++
C++ is a statically typed, compiled, general purpose,
case-sensitive, free-form programming language that
supports procedural, object-oriented, and generic
programming. C++ is regarded as a middle-level
language, as it comprises a combination of both
high-level and low-level language features. C++ was
developed by Bjarne Stroustrup starting in 1979 at
Bell Labs in Murray Hill, New Jersey as an
enhancement to the C language and originally
named C with Classes but later it was renamed C++
in 1983. C++ is a superset of C, and that virtually any
legal C program is a legal C++ program. The most
important thing to do when learning C++ is to focus
on concepts and not get lost in language technical
details. This software is developed in the
programming language C++ available in the syllabus
of CBSE XII for the academic year 2016-2017.
INTRODUCTION

The computerized library management system has proved a boon


for the management of large educational institutions. The colleges
and universities have immensely benefitted from it reducing cost
and complexity involved in managing huge libraries, increasing
productivity and performance and better accountability on the
part of library staff. The use of library management system helps
the librarian and other staff members to manage library easily
along with saving time. This allows the librarian to catalogue
books and to maintain records of issued reissued and overdue
books easily. It consists of the comprehensive options for entering
the information related to books thus helping to maintain the
complete library right from the transactions between student,
staff and institute to issuing, returning and reissuing of books to
maintaining membership information on one centralized server.
This has eased and made the process of borrowing books error
free for everyone. In fact every little task which was done
manually by library staff has been fully automated so as to
smoothen the working of library along with bringing transparency
in its functioning and improving trust between the students and
the management.
SYSTEM REQUIREMENTS
HARDWARE REQUIREMENTS
Processor: Intel Pentium IV
RAM: 512 MB
Hard Disk: 40GB
SOFTWARE REQUIREMENTS
Operating System: Windows 98,
2000, XP, 7, 8, 8.1, 10
Tools: Turbo C++ 3.0
Technologies: DOS 7.0
AIM OF THE PROJECT
This project is on how to perform library
management effectively, fast and easily.
Management using pen and paper is absurd in the
modern era. These days most of the schools and
institution shave large libraries and students
frequently issue books, so librarians often find it
difficult to manage the process manually. On the
other hand, a virtual library management system
eliminates all these burdens. By using this system,
all records can be generated quickly. This is a very
versatile project that allows the user (the librarian)
to enter the name, number, and other details of
books that are issued by a student. Thus the
project aims in creating a good user-friendly library
management system reducing human strain to a
large extent.
HEADER FILES USED-:
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<dos.h>
#include<graphics.h>
#include<iomanip.h>
SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<dos.h>
#include<graphics.h>
#include<iomanip.h>
struct book
{
char bn[30];
char an[25];
int sno;
float price;
};
book b[30];
struct student
{
char name[25];
int cls,adm;
};
student s[20];
int y,z;
int i=1;
int j=1;
int k=1;
char ibn[10][30];
char ian[10][25];
char isn[10][25];
int l=1;
int isno[10];
textcolor();
textbackground();
void booklist();
void student();
void librarian();
void menu();
void bdata();
void sdata();
void slist();
void bdel();
void sdel();
void searchbook();
void searchstudent();
void bmodify();
void smodify();
void issue();
void issue1();
void issuedbook();
void bmodify1();
void bdel1();
void smodify1();
void sdel1();
void bdata1();
void sdata1();
void password();
void booklist1();
void slist1();
void searchbook1();
void issuedbook1();
void main()
{
clrscr();
textcolor(2);
cprintf("");
bdata();
getch();
}
void menu()
{
clrscr();
cout<<"-------------------------------------------------------------------------\n";
cout<<"************************ WELCOME TO LIBRARY MANAGEMENT*******************";
cout<<endl;
cout<<"-------------------------------------------------------------------------\n";
cout<<"\nmain menu:-\n";
int x;
cout<<"log in as:\n1.student\n2.librarian\n3.view booklist\n4.view student list\n5.view issued books\n6.exit
application\n";
cin>>x;
switch(x)
{
case 1:
student();
break;
case 2:
password();
break;
case 3:
booklist1();
break;
case 4:
slist1();
case 5:
issuedbook1();
break;
case 6:
exit(0);
break;
default:
menu();
break;
}
getch();
}
void bdata()
{
clrscr();
char y;
cout<<"------------------------------------------------------------------------\n";
cout<<"************************ WELCOME TO LIBRARY MANAGEMENT*******************";
cout<<endl;
cout<<"-------------------------------------------------------------------------\n";
char x;
cout<<"enter the books detail:\n";
cout<<"enter serial number:";
cin>>b[i].sno;
cout<<"enter book"<<i<<" name:";
gets(b[i].bn);
cout<<"enter book"<<i<<" author name:";
gets(b[i].an);
cout<<"enter book"<<i<<" price(in rs.):";
cin>>b[i].price;
i++;
cout<<endl<<"want to add more book:\n";
cin>>x;
if(x=='y'|| x=='Y')
bdata();
else if(x=='n'||x=='N')
{
cout<<"wnat to add student data:";
cin>>y;
if(y=='y'||y=='Y')
sdata();
else if(y=='n'||y=='N')
menu();
}
else
exit(0);
getch();
}
void sdata()
{
clrscr();
cout<<"---------------------------------------------------------------------\n";
cout<<"*********************WELCOME TO LIBRARY MANAGEMENT*******************\n";
cout<<"---------------------------------------------------------------------\n";
cout<<"enter students detail:\n";
cout<<"enter student"<<j<<" name:";
gets(s[j].name);
cout<<endl<<"enter student"<<j<<" admission number:";
cin>>s[j].adm;
cout<<endl<<"enter student"<<j<<" class:";
cin>>s[j].cls;
j++;
cout<<endl;
cout<<"want to add more students:";
char x;
cin>>x;
if(x=='y'||x=='Y')
sdata();
else if(x=='n'||x=='N')
menu();
else
exit(0);
}
void librarian()
{
clrscr();
int x;
cout<<"-----------------------------welcome librarian--------------------------\n";
cout<<"please select one option:\n";
cout<<"1.view available books\n2.view student list\n3.add book\n4.modify book\n5.delete book\n";
cout<<"6.search for book\n7.add student\n8.modify student\n9.search for student\n10.delete student\n";
cout<<"11.issue book\n12.view issued books\n13.exit application\n14.go to main menu\n";
cin>>x;
switch(x)
{
case 1:
booklist();
break;
case 2:
slist();
break;
case 3:
bdata1();
break;
case 4:
bmodify();
break;
case 5:
bdel();
break;
case 6:
searchbook();
break;
case 7:
sdata1();
break;
case 8:
smodify();
break;
case 9:
searchstudent();
break;
case 10:
sdel();
break;
case 11:
issue();
break;
case 12:
issuedbook();
break;
case 13:
exit(0);
break;
case 14:
menu();
break;
default:
exit(0);
}}
void bmodify()
{
clrscr();
int x,p=1,s;
cout<<"enter serial number of book you want to modify:";
cin>>x;
for(int j=1;j<i;j++)
{
if(b[j].sno==x)
{
cout<<endl;
cout<<"you want to modify:\n";
cout<<b[x].bn<<" by "<<b[x].an;
cout<<"\nenter new book name:";
gets(b[x].bn);
cout<<"\nenter new author name:";
gets(b[x].an);
cout<<"\nenter book price:";
cin>>b[x].price;
b[j].price=b[x].price;
}
else if(b[j].sno!=x)
p++;
}
if(p==i)
{
cout<<endl;
cout<<"no book found with that serial number"<<endl;
cout<<"1.goto main menu\n2.goto librarian menu\n3.try to modify book again\n";
cin>>s;
switch(s)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
bmodify();
break;
}}
else if(p!=i)
{
char a;
cout<<endl;
cout<<"do you want to modify more book:";
cin>>a;
if(a=='y'||a=='Y')
bmodify();
else if(a=='n'||a=='N')
{
int b;
cout<<"where you want to go now:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>b;
switch(b)
{
case 1:
menu();
break;
case 2:
librarian();
break;
default:
exit(0);
}
}
}
}
void smodify()
{
clrscr();
int x,p=1,r;
cout<<"enter admission number you want to modify:";
cin>>x;
for(int k=1;k<i;k++)
{
if(s[k].adm==x)
{
cout<<"you want to modify:";
cout<<s[k].name<<" of class"<<s[k].cls;
cout<<"enter new student name:";
gets(s[k].name);
cout<<"enter student class:";
cin>>s[k].cls;
cout<<"enter student admission number:";
cin>>s[x].adm;
s[x].cls=s[k].cls;
s[k].adm=s[x].adm;
}
else if(s[k].adm!=x)
p++;
}
if(p==i)
{
cout<<endl;
cout<<"no student found with that serial number"<<endl;
cout<<"1.goto main menu\n2.librarian menu\n3.try to modify again\n";
cin>>r;
switch(r)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
smodify();
break;
}
}
if(p!=i)
{
char a;
cout<<endl;
cout<<"do you want to modify more students:";
cin>>a;
if(a=='y'||a=='Y')
smodify();
else if(a=='n'||a=='N')
{
int b;
cout<<endl;
cout<<"where you want to go now:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>b;
switch(b)
{
case 1:
menu();
break;
case 2:
librarian();
break;
default:
exit(0);
}
}
}
}
void bdata1()
{
clrscr();
cout<<"------------------------------------------------------------------\n";
cout<<"\t\t\t\tWELCOME TO LIBRARY MANAGEMENT\n";
cout<<"------------------------------------------------------------------\n";
char x;
cout<<"enter the books detail:\n";
cout<<"enter serial number:";
cin>>b[i].sno;
cout<<endl;
cout<<"enter book"<<i<<" name:";
gets(b[i].bn);
cout<<endl<<"enter book"<<i<<" author name:";
gets(b[i].an);
cout<<endl<<"enter book"<<i<<" price(in rs.):";
cin>>b[i].price;
i++;
cout<<"\nbook updated successfully"<<endl;
cout<<"want to add more book:\n";
cin>>x;
if(x=='y'|| x=='Y')
bdata();
else if(x=='n'||x=='N')
{
int a;
cout<<endl;
cout<<"do you want to go to:\n";
cout<<"1.main menu\n2.librarian menu";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
librarian();
break;
}
}
}
void sdata1()
{
clrscr();
cout<<"---------------------------------------------------------------------\n";
cout<<"\t\t\t WELCOME TO LIBRARY MANAGEMENT\n";
cout<<"---------------------------------------------------------------------\n";
cout<<"enter students details:\n";
cout<<"enter student"<<j<<" name:";
gets(s[j].name);
cout<<endl<<"enter student"<<j<<" admission number:";
cin>>s[j].adm;
cout<<endl<<"enter student"<<j<<" class:";
cin>>s[j].cls;
j++;
cout<<endl;
cout<<"student updated"<<endl;
cout<<"want to add more students:";
char x;
cin>>x;
if(x=='y'||x=='Y')
sdata();
else if(x=='n'||x=='N')
{
int b;
cout<<endl;
cout<<"goto:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>b;
switch(b)
{
case 1:
menu();
break;
case 2:
librarian();
break;
}
}
}
void bdel()
{
clrscr();
int x,p=1,s;
cout<<endl;
cout<<"enter serial number of book you want to delete:";
cin>>x;
for(int j=1;j<i;j++)
{
if(b[j].sno==x)
{
cout<<endl;
cout<<"you want to delete:\n";
cout<<b[j].bn<<" by "<<b[j].an;
for(int k=j;k<i;k++)
{
b[k].sno=b[k+1].sno;
strcpy(b[k].bn,b[k+1].bn);
strcpy(b[k].an,b[k+1].an);
b[k].price=b[k+1].price;
}
}
else if(b[j].sno!=x)
p++;
}
if(p==i)
{
cout<<endl;
cout<<"sorry!!! no book found with that serial number"<<endl;
cout<<"1.goto main menu\n2.goto librarian menu\n3.try to delete again"<<endl;
cin>>s;
switch(s)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
bdel();
break;
}
}
if(p!=i)
{
char a;
i--;
cout<<endl;
cout<<"do you want to delete more books:";
cin>>a;
if(a=='y'||a=='Y')
bdel();
else if(a=='n'||a=='N')
{
int b;
cout<<endl;
cout<<"where you want to go now:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>b;
switch(b)
{
case 1:
menu();
break;
case 2:
librarian();
break;
default:
exit(0);
}
}
}
}
void sdel()
{
clrscr();
int x,p=1,r;
cout<<"enter admission number of student you want to delete:";
cin>>x;
for(int i=1;i<j;i++)
{
if(s[i].adm==x)
{
cout<<endl<<"you want to delete:\n";
cout<<s[i].name<<" of class"<<s[i].cls;
for(int k=i;k<j;k++)
{
s[k].adm=s[k+1].adm;
strcpy(s[k].name,s[k+1].name);
s[k].cls=s[k+1].cls;
}
}
else if(s[i].adm!=x)
p++;
}
if(p==j)
{
cout<<endl<<"no student found with that admission number"<<endl;
cout<<"1.goto main menu\n2.goto librarian menu\n3.try to delete again";
cin>>r;
switch(r)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
sdel();
break;
}
}
else if(p!=j)
{
char a;
j--;
cout<<endl;
cout<<"student deleted successfully"<<endl;
cout<<"do you want to delete more students:";
cin>>a;
if(a=='y'||a=='Y')
sdel();
else if(a=='n'||a=='N')
{
int b;
cout<<endl;
cout<<"where you want to go now:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>b;
switch(b)
{
case 1:
menu();
break;
case 2:
librarian();
break;
default:
exit(0);
}
}
}
}
void searchbook()
{
clrscr();
int x,p=1,r;
cout<<"enter serial number of book you want to search:";
cin>>x;
for(int j=1;j<i;j++)
{
if(b[j].sno==x)
{
cout<<"you searched for "<<b[j].bn<<" by "<<b[j].an<<endl;
y=j;
}
else if(b[j].sno!=x)
p++;
}
if(p==i)
{
cout<<"sorry!!! no book found with that serial number";
cout<<endl;
cout<<"1.goto main menu\n2.goto librarian menu\n3.search again\n";
cin>>r;
switch(r)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
searchbook();
break;
}
}
else if(p!=i)
{
int a;
cout<<"what do you want to do with this:\n";
cout<<"1.modify\n2.delete\n3.goto main menu\n";
cin>>a;
switch(a)
{
case 1:
bmodify1();
break;
case 2:
bdel1();
break;
case 3:
menu();
break;
default:
exit(0);
}
}
}
void bmodify1()
{
clrscr();
int x;
x=y;
cout<<"enter new book name:";
gets(b[y].bn);
cout<<"enter author name:";
gets(b[y].an);
cout<<"enter book price:";
cin>>b[y].price;
b[x].price=b[y].price;
int a;
cout<<endl;
cout<<"book modified successfully!!!"<<endl;
cout<<"want to go on:\n";
cout<<"1.main menu\n2.librarian menu\n3.search book\n";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
searchbook();
break;
default:
exit(0);
}
}
void bdel1()
{
clrscr();
for(int j=y;j<i;j++)
{
b[j].sno=b[j+1].sno;
strcpy(b[j].bn,b[j+1].bn);
strcpy(b[j].an,b[j+1].an);
b[j].price=b[j+1].price;
}
i--;
int a;
cout<<"book deleted successfully!!!"<<endl;
cout<<"want to go on:\n";
cout<<"1.main menu\n2.librarian menu\n3.search book\n";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
searchbook();
break;
default:
exit(0);
}
}
void searchstudent()
{
clrscr();
int x,p=1,r;
cout<<"enter admission number of student to be search:";
cin>>x;
for(int i=1;i<j;i++)
{
if(s[i].adm==x)
{
z=i;
cout<<"you searched for "<<s[i].name<<" of class"<<s[i].cls;
}
else if(s[i].adm!=x)
p++;
}
if(p==j)
{
cout<<endl<<"no student found with that admission number"<<endl;
cout<<"1.goto main menu\n2.goto student menu\n3.search again\n";
cin>>r;
switch(r)
{
case 1:
menu();
break;
case 2:
student();
break;
case 3:
searchstudent();
break;
}
}
else if(p!=j)
{
cout<<endl;
cout<<"what do you want to do with this:\n";
cout<<"1.modify\n2.delete\n3.goto main menu\n";
int a;
cin>>a;
switch(a)
{
case 1:
smodify1();
break;
case 2:
sdel1();
break;
case 3:
menu();
break;
default:
menu();
}
}
}
void smodify1()
{
clrscr();
cout<<"enter new name:";
gets(s[z].name);
cout<<"enter admission number:";
cin>>s[z].adm;
cout<<"enter student class:";
cin>>s[z].cls;
cout<<endl;
cout<<"student modified successfully!!!"<<endl;
int a;
cout<<"want to go on:\n";
cout<<"1.main menu\n2.librarian menu\n3.search student\n";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
searchstudent();
break;
default:
menu();
}
}
void sdel1()
{
clrscr();
for(int i=z;i<j;i++)
{
strcpy(s[i].name,s[i+1].name);
s[i].adm=s[i+1].adm;
s[i].cls=s[i+1].cls;
}
j--;
int a;
cout<<"student deleted successfully"<<endl;
cout<<"want to go on:\n";
cout<<"1.main menu\n2.librarian menu\n3.search student\n";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
searchstudent();
break;
default:
menu();
}
}
void issue()
{
clrscr();
int x;
char c;
int d,p=1;
char a[25];
cout<<"enter serial number of book you want to issue:";
cin>>x;
for(int j=1;j<i;j++)
{
if(b[j].sno==x)
{
cout<<endl<<"enter name of student you want to issue book:";
gets(a);
strcpy(ibn[l],b[j].bn);
strcpy(ian[l],b[j].an);
strcpy(isn[l],a);
isno[l]=j;
cout<<endl;
cout<<"you want to issue "<<b[j].bn<<" by "<<b[j].an<<" to "<<a;
for(int k=x;k<i;k++)
{
b[k].sno=b[k+1].sno;
strcpy(b[k].bn,b[k+1].bn);
strcpy(b[k].an,b[k+1].an);
b[k].price=b[k+1].price;
}
}
else if(b[j].sno!=x)
p++;
}
if(p==i)
{
int q;
cout<<endl;
cout<<"sorry!!!no book found with that serial number"<<endl;
cout<<"1.goto main menu\n2.librarian menu\n3.try to issue again\n";
cin>>q;
switch(q)
{
case 1:
menu();
break;
case 2:
librarian();
break;
case 3:
issue();
break;
}
}
else if(p!=i)
{
i--;
l++;
cout<<endl;
cout<<"book issued successfully"<<endl;
cout<<"do you want to issue more books:";
cin>>c;
if(c=='y'||c=='Y')
issue();
else
{
cout<<"goto:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>d;
switch(d)
{
case 1:
menu();
break;
case 2:
librarian();
break;
}
}
}
}
void password()
{
clrscr();
char x[4];
int a;
cout<<"enter password:";
x[0]=getch();
cout<<"*";
x[1]=getch();
cout<<"*";
x[2]=getch();
cout<<"*";
x[3]=getch();
cout<<"*";
if(x[0]=='p' && x[1]=='a' && x[2]=='s' && x[3]=='s')
librarian();
else
{
cout<<"you entered a wrong password,try again!!!"<<endl;
cout<<"1.goto main menu\n2.try again\n";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
password();
break;
}
}
}
void student()
{
clrscr();
int x;
cout<<"---------------------------welcome student-------------------------\n";
cout<<"please choose one option:\n";
cout<<"1.view booklist\n2.issue book\n3.search for a book\n4.goto main menu\n5.exit application\n";
cin>>x;
switch(x)
{
case 1:
booklist1();
break;
case 2:
issue1();
break;
case 3:
searchbook1();
break;
case 4:
menu();
break;
case 5:
exit(0);
break;
}
}
void issue1()
{
clrscr();
int x;
char c;
int d,p=1;
char a[25];
cout<<"enter serial number of book you want to issue:";
cin>>x;
for(int j=1;j<i;j++)
{
if(b[j].sno==x)
{
cout<<endl<<"enter your name:";
gets(a);
strcpy(ibn[l],b[j].bn);
strcpy(ian[l],b[j].an);
strcpy(isn[l],a);
isno[l]=j;
cout<<"hii "<<a<<", you want to issue "<<b[j].bn<<" by "<<b[j].an<<endl<<"book issued succesfully\n";
for(int k=j;k<i;k++)
{
b[k].sno=b[k+1].sno;
strcpy(b[k].bn,b[k+1].bn);
strcpy(b[k].an,b[k+1].an);
b[k].price=b[k+1].price;
}
}
else if(b[j].sno!=x)
p++;
}
if(p==i)
{
int q;
cout<<endl;
cout<<"sorry!!!no book found with that serial number"<<endl;
cout<<"1.goto main menu\n2.student menu\n3.try to issue again\n";
cin>>q;
switch(q)
{
case 1:
menu();
break;
case 2:
student();
break;
case 3:
issue1();
break;
}
}
else if(p!=i)
{
i--;
l++;
cout<<endl;
cout<<"book issued successfully"<<endl;
cout<<"do you want to issue more books:";
cin>>c;
if(c=='y'||c=='Y')
issue();
else
{
cout<<"goto:\n";
cout<<"1.main menu\n2.student menu\n";
cin>>d;
switch(d)
{
case 1:
menu();
break;
case 2:
student();
break;
}
}
}
}
void issuedbook()
{
clrscr();
int x;
cout<<"sno"<<setw(25)<<"issued books"<<setw(25)<<"author name"<<setw(24)<<"student name"<<endl;
cout<<"--------------------------------------------------------------------\n";
for(int i=1;i<l;i++)
cout<<i<<setw(25)<<ibn[i]<<setw(25)<<ian[i]<<setw(24)<<isn[i];
cout<<endl;
cout<<"goto:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>x;
switch(x)
{
case 1:
menu();
break;
case 2:
librarian();
break;
}
}
void issuedbook1()
{
clrscr();
int x;
cout<<"sno"<<setw(25)<<"issued books"<<setw(25)<<"author name"<<setw(24)<<"student name"<<endl;
cout<<"--------------------------------------------------------------------------------\n";
for(int i=1;i<l;i++)
cout<<i<<setw(25)<<ibn[i]<<setw(25)<<ian[i]<<setw(24)<<isn[i];
cout<<endl;
cout<<"goto:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>x;
switch(x)
{
case 1:
menu();
break;
case 2:
password();
break;
}
}

void searchbook1()
{
clrscr();
int x;
cout<<"enter serial number of book you want to search:";
cin>>x;
int a,p=1;
for(int j=1;j<i;j++)
{
if(b[j].sno==x)
cout<<"you searched for "<<b[j].bn<<" by "<<b[j].an;
else if(b[j].sno!=x)
p++;
}
if(p==i)
cout<<"sorry!!!no book found";
cout<<endl;
cout<<"where you want to go:\n";
cout<<"1.main menu\n2.student menu\n";
cin>>a;
switch(a)
{
case 1:
menu();
break;
case 2:
student();
break;
}
}
void booklist()
{
clrscr();
int x;
cout<<"sno"<<setw(25)<<"bookname"<<setw(25) <<"author name"<<setw(24)<<"price"<<endl;
cout<<"------------------------------------------------------------------------------\n";
for(int k=1;k<i;k++)
{
cout<<b[k].sno<<setw(25)<<b[k].bn<<setw(25)<<b[k].an<<setw(24)<<b[k].price<<"\n";
}
cout<<"want to go on:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>x;
switch(x)
{
case 1:
menu();
break;
case 2:
librarian();
break;
}
}
void slist()
{
clrscr();
int x;
cout<<"admission no."<<setw(25)<<"student name"<<setw(20)<<"class"<<endl;
cout<<"-----------------------------------------------------------------------\n";
for(int k=1;k<j;k++)
cout<<s[k].adm<<setw(35)<<s[k].name<<setw(20)<<s[k].cls<<"\n";
cout<<"\nwant to go on:\n";
cout<<"1.main menu\n2.librarian menu\n";
cin>>x;
switch(x)
{
case 1:
menu();
break;
case 2:
librarian();
break;
}
}
void booklist1()
{
clrscr();
int x;
cout<<"sno"<<setw(25)<<"book name"<<setw(25)<<"author name"<<setw(22)<<"price"<<endl;
cout<<"-----------------------------------------------------------------------\n";
for(int k=1;k<i;k++)
{
cout<<b[k].sno<<setw(25)<<b[k].bn<<setw(25)<<b[k].an<<setw(22)<<b[k].price<<"\n";
}
cout<<"want to go:\n";
cout<<"1.main menu\n2.student menu\n3.librarian menu\n";
cin>>x;
switch(x)
{
case 1:
menu();
break;
case 2:
student();
break;
case 3:
password();
}
}
void slist1()
{
clrscr();
int x;
cout<<"admission no. "<<setw(25)<<"student name"<<setw(20)<<"class"<<endl;
cout<<"------------------------------------------------------------------------\n";
for(int k=1;k<j;k++)
cout<<s[k].adm<<"."<<setw(35)<<s[k].name<<setw(20)<<s[k].cls<<"\n";
cout<<"want to go:\n";
cout<<"1.main menu\n2.student menu\n3.librarian menu\n";
cin>>x;
switch(x)
{
case 1:
menu();
break;
case 2:
student();
break;
case 3:
password();
}
}
OUTPUT
BIBLIOGRAPHY
TOOLS:TURBO C++ 3.0,NOTEPAD
WEBSITES:WWW.CPLUSPLUS.COM,
WWW.SCRIBD.COM

BOOKS: TEXTBOOK CLASS XI


(SUMITA ARORA)

THE END

You might also like