OOP MicroProject
OOP MicroProject
Submitted by:-
Roll Number Name of Student Enrollment Number
06 Prajwal Dhage 2216490211
07 Tejas Mahajan 2216490213
08 Om Wakhchaure 2216490214
09 Vishal Tengle 2216490215
10 Sahil Jamnik 2216490216
CERTIFICATE
This is to certify that Project report entitled "Library Management System" is
submitted in the partial fulfilment of requirement for the award of the Diploma in
Computer Engineering by Maharashtra State Board of Technical Education as record
of students' own work carried out by them under the guidance and supervision at DY
Patil School Of Engineering (Charholi), during the academic year 2022-23.
1. Brief Introduction:
The Management system is the system used to manage the system information by
storing it in sequential manner and in readable format which can be edited When
necessary it can be updated, deleted and used to keep the data secure.
In this Project we have made the Library management system in which the
manager can easily find the books necessary easily and enter the updated new
books and maintain the information of giving the books to the students.
2. RAM 8GB
Tejas Mahajan 07
Om Wakhchaure 08
Vishal Tengle 09
Sahil Jamnik 10
1. Brief Introduction:
A library management system is software that is designed to manage all the functions of a
library. It helps librarian to maintain the database of new books and the books that are borrowed
by members along with their due dates.
This system completely automates all your library’s activities. The best way to maintain,
organize, and handle countless books systematically is to implement a library management
system software.
A library management system is used to maintain library records. It tracks the records of the
number of books in the library, how many books are issued, or how many books have been
returned or renewed or late fine charges, etc.
The project is totally built at administrative end and thus only the administrator is guaranteed
the access.
It tracks the records of the number of books in the library, how many books are issued, or
how many books have been returned or renewed or late fine charges, etc.
3. Course Outcomes Integrated:
Making the Library management system run smoothly.
Name of Specification
resources/Material
Sr.
No.
2. RAM 16GB
Code
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<fstream>
#include<string.h>
#include<conio.h>
using namespace std;
class Lib
{
public:
char bookname[100],auname[50],sc[20],sc1[50];
int q,B,p;
Lib()
{
strcpy(bookname,"NO Book Name");
strcpy(auname,"NO Author Name");
strcpy(sc,"NO Book ID");
strcpy(sc1,"NO Book ID");
q=0;
B=0;
p=0;
}
void get();
void student();
void pass();
void librarian();
void password();
void getdata();
void show(int);
void booklist(int);
void modify();
void see(int);
int branch(int);
void issue();
void der(char[],int,int);
void fine(int,int,int,int,int,int);
};
void Lib::getdata()
{
int i;
fflush(stdin);
cout<<"\n\t\tEnter the Details -------->\n";
cout<<"\n\t\tEnter Book's Name :----> ";
cin.getline(bookname,100);
for(i=0;bookname[i]!='\0';i++)
{
if(bookname[i]>='a'&&bookname[i]<='z')
bookname[i]-=32;
}
cout<<"\n\t\tEnter Author's Name :----> ";
cin.getline(auname,50);
cout<<"\n\t\tEnter Publication name :----> ";
cin.getline(sc1,50);
cout<<"\n\t\tEnter Book's ID :----> ";
cin.getline(sc,20);
cout<<"\n\t\tEnter Book's Price :----> ";
cin>>p;
cout<<"\n\t\tEnter Book's Quantity :----> ";
cin>>q;
}
void Lib::show(int i)
{
cout<<"\n\t\tBook Name :----> "<<bookname<<endl;
cout<<"\n\t\tBook's Author Name :----> "<<auname<<endl;
cout<<"\n\t\tBook's ID :----> "<<sc<<endl; cout<<"\n\t\
tBook's Publication :----> "<<sc1<<endl; if(i==2)
{
cout<<"\n\t\tBook's Price :----> "<<p<<endl;
cout<<"\n\t\tBook's Quantity :----> "<<q<<endl;
}
}
void Lib::booklist(int i)
{
int b,r=0;
system("cls");
b=branch(i);
system("cls");
ifstream intf("Booksdata.txt",ios::binary);
if(!intf)
cout<<"\n\t\tBook Not Found. ..........";
else
{
cout<<"\n\t ************ Book List ************ \n\n";
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
if(b==B)
{
if(q==0 && i==1)
{
}
else
{
r++;
cout<<"\n\t\t********** "<<r<<". ********** \n";
show(i);
}
}
intf.read((char*)this,sizeof(*this));
}
}
cout<<"\n\t\tPress Any Key To Continue. ......";
getch();
system("cls");
if(i==1)
student();
else
librarian();
}
void Lib::modify()
{
char ch,st1[100];
int i=0,b,cont=0;
system("cls");
cout<<"\n\t\t>>Please Choose One Option ---------->\n";
cout<<"\n\t\t1.Modify Current Books\n\n\t\t2.Add New Book\n\n\t\t3.Delete A
Book\n\n\t\t4.Go Back\n";
cout<<"\n\n\t\tEnter Your Choice : ";
cin>>i;
if(i==1)
{
system("cls");
b=branch(2);
ifstream intf1("Booksdata.txt",ios::binary);
if(!intf1)
{
cout<<"\n\t\tBook Not Found ............\n";
cout<<"\n\t\tPress Any Key To Continue .........";
getch();
system("cls");
librarian();
}
intf1.close();
system("cls");
cout<<"\n\t\tPlease Choose One Option :-\n";
cout<<"\n\t\t1.Search By Book Name\n\n\t\t2.Search By Book's ID\n";
cout<<"\n\t\tEnter Your Choice : ";
cin>>i;
fflush(stdin);
if(i==1)
{
system("cls"); cout<<"\n\t\
tEnter Book Name : ";
cin.getline(st1,100);
system("cls");
fstream
intf("Booksdata.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;b==B&&bookname[i]!='\0'&&st1[i]!='\0'&&(st1[
i]==bookname[i]||st1[i]==bookname[i]+32);i++);
if(bookname[i]=='\0'&&st1[i]=='\0')
{
cont++;
getdata();
intf.seekp(intf.tellp()-=sizeof(*this));
intf.write((char*)this,sizeof(*this));
break;
}
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else if(i==2)
{
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,100);
system("cls");
fstream
intf("Booksdata.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;b==B&&sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[
i];i++);
if(sc[i]=='\0'&&st1[i]=='\0')
{
6ont++;
getdata();
intf.seekp(intf.tellp()-=sizeof(*this));
intf.write((char*)this,sizeof(*this));
break;
}
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else
{
cout<<"\n\t\tIncorrect Input .......(\n";
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
modify();
}
if(cont==0)
{
cout<<"\n\t\tBook Not Found ..........\n";
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
modify();
}
else
cout<<"\n\t\tUpdated Successfully ........\n";
}
else if(i==2)
{
system("cls");
B=branch(2);
system("cls");
getdata();
ofstream outf("Booksdata.txt",ios::app|ios::binary);
outf.write((char*)this,sizeof(*this));
outf.close();
cout<<"\n\t\tBook Added Successfully. ..........\n";
}
else if(i==3)
{
system("cls");
b=branch(2);
ifstream intf1("Booksdata.txt",ios::binary);
if(!intf1)
{
cout<<"\n\t\tBook Not Found ..........\n";
cout<<"\n\t\tPress Any Key To Continue .......";
getch();
intf1.close();
system("cls");
librarian();
}
intf1.close();
system("cls");
cout<<"\n\t\tPlease Choose Any One Option For Deletion:-\n";
cout<<"\n\t\t1.By Book Name\n\n\t\t2.By Book's ID\n"; cout<<"\n\t\
tEnter Your Choice : ";
cin>>i;
fflush(stdin);
if(i==1)
{
system("cls"); cout<<"\n\t\
tEnter Book Name : ";
cin.getline(st1,100);
ofstream outf("temp.txt",ios::app|ios::binary);
ifstream intf("Booksdata.txt",ios::binary);
intf.read((char*)this,sizeof(*this)); while(!
intf.eof())
{
for(i=0;b==B&&bookname[i]!='\0'&&st1[i]!='\0'&&(st1[
i]==bookname[i]||st1[i]==bookname[i]+32);i++);
if(bookname[i]=='\0'&&st1[i]=='\0')
{
cont++;
intf.read((char*)this,sizeof(*this));
}
else
{
outf.write((char*)this,sizeof(*this));
intf.read((char*)this,sizeof(*this));
}
}
intf.close();
outf.close();
remove("Booksdata.txt");
rename("temp.txt","Booksdata.txt");
}
else if(i==2)
{
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,100);
ofstream outf("temp.txt",ios::app|ios::binary);
ifstream intf("Booksdata.txt",ios::binary);
intf.read((char*)this,sizeof(*this)); while(!
intf.eof())
{
for(i=0;b==B&&sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[
i];i++);
if(sc[i]=='\0'&&st1[i]=='\0')
{
cont++;
intf.read((char*)this,sizeof(*this));
}
else
{
outf.write((char*)this,sizeof(*this));
intf.read((char*)this,sizeof(*this));
}
}
outf.close();
intf.close();
remove("Booksdata.txt");
rename("temp.txt","Booksdata.txt");
}
else
{
cout<<"\n\t\tIncorrect Input .......(\n";
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
modify();
}
if(cont==0)
{
cout<<"\n\t\tBook Not Found ..........\n";
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
modify();
}
else
cout<<"\n\t\tDeleted Successfully ..........\n";
}
else if(i==4)
{
system("cls");
librarian();
}
else
{
cout<<"\n\t\tWrong Input. ........\n";
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
modify();
}
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
librarian();
}
int Lib::branch(int x)
{
int i;
cout<<"\n\t\t>>Enter The Branch ---------->\n";
cout<<"\n\t\t1.Computer\n\n\t\t2.Artificial Intelligence\n\n\t\t3.Mechanical\n\n\t\
t4.Go To Main Menu\n";
cout<<"\n\t\tEnter Your Choice : ";
cin>>i;
switch(i)
{
case 1: return 1;
break;
case 2: return 2;
break;
case 3: return 3;
break;
case 4: return 4;
break;
case 5: return 5;
break;
case 6: return 6;
break;
case 7: system("cls");
if(x==1)
student();
else
librarian();
default : cout<<"\n\t\tPlease Enter Correct Option :(";
getch();
system("cls");
branch(x);
}
}
void Lib::see(int x)
{
int i,b,cont=0;
char ch[100];
system("cls");
b=branch(x);
ifstream intf("Booksdata.txt",ios::binary); if(!
intf)
{
cout<<"\n\t\tBook Not Found ..........\n";
cout<<"\n\t\t->Press Any Key to Continue .......";
getch();
system("cls");
if(x==1)
student();
else
librarian();
}
system("cls");
cout<<"\n\t\tPlease Choose One Option ---------->\n";
cout<<"\n\t\t1.Search By Name\n\n\t\t2.Search By Book's ID\n";
cout<<"\n\t\tEnter Your Choice : ";
cin>>i;
fflush(stdin);
intf.read((char*)this,sizeof(*this));
if(i==1)
{
cout<<"\n\t\tEnter Book's Name :-----> ";
cin.getline(ch,100);
system("cls");
while(!intf.eof())
{
for(i=0;b==B&&q!=0&&bookname[i]!='\0'&&ch[i]!='\0'&&(ch[i]==bookname[i]||ch[i]==
bookname[i]+32);i++);
if(bookname[i]=='\0'&&ch[i]=='\0')
{
cout<<"\n\t\tBook Found -------->\n";
show(x);
cont++;
break;
}
intf.read((char*)this,sizeof(*this));
}
}
else if(i==2)
{
cout<<"\n\t\tEnter Book's ID :-----> ";
cin.getline(ch,100);
system("cls");
while(!intf.eof())
{
for(i=0;b==B&&q!=0&&sc[i]!='\0'&&ch[i]!='\0'&&ch[i]==sc[i];i++);
if(sc[i]=='\0'&&ch[i]=='\0')
{
cout<<"\n\t\tBook Found ---------->\n";
show(x);
cont++;
break;
}
intf.read((char*)this,sizeof(*this));
}
}
else
{
cont++;
cout<<"\n\t\tPlease Enter Correct Option :(";
getch();
system("cls");
see(x);
}
intf.close();
if(cont==0)
cout<<"\n\t\tThis Book Is Not Available........( \n";
cout<<"\n\t\tPress Any Key To Continue ........";
getch();
system("cls");
if(x==1)
student();
else
librarian();
}
void Lib::issue()
{
char st[50],st1[20];
int b,i,j,d,m,y,dd,mm,yy,cont=0;
system("cls");
cout<<"\n\t\t->Please Choose One Option -------->\n";
cout<<"\n\t\t1.Issue Book\n\n\t\t2.View Issued Book\n\n\t\t3.Search Student Who Checkout
Books\n\n\t\t4.Reissue Book\n\n\t\t5.Return Book\n\n\t\t6.Go Back To Menu\n\n\t\tEnter Your
Choice : ";
cin>>i;
fflush(stdin);
if(i==1)
{
system("cls");
b=branch(2);
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details -------->\n";
cout<<"\n\t\tEnter Book Name : ";
cin.getline(bookname,100);
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(sc,20);
//strcpy(st,sc);
der(sc,b,1);
cout<<"\n\t\tEnter Student Name : ";
cin.getline(auname,100); cout<<"\n\
t\tEnter Student's ID : ";
cin.getline(sc1,20); cout<<"\n\t\
tEnter Date : "; cin>>q>>B>>p;
ofstream outf("student.txt",ios::binary|ios::app);
outf.write((char*)this,sizeof(*this));
outf.close();
cout<<"\n\n\t\tIssued Successfully. ............\n";
}
else if(i==2)
{
ifstream intf("student.txt",ios::binary);
system("cls");
cout<<"\n\t\t->The Details Are ---------->\n";
intf.read((char*)this,sizeof(*this));
i=0;
while(!intf.eof())
{ i+
+;
cout<<"\n\t\t********** "<<i<<". ********** \n";
cout<<"\n\t\tStudent Name : "<<auname<<"\n\t\t"<<"Student's ID : "<<sc1<<"\n\t\t"<<"Book
Name : "<<bookname<<"\n\t\t"<<"Book's ID : "<<sc<<"\n\t\t"<<"Date : "<<q<<"/"<<B<<"/"<<p<<"\
n";
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else if(i==3)
{
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details --------->\n";
cout<<"\n\n\t\tEnter Student Name : ";
cin.getline(st,50); cout<<"\n\n\t\
tEnter Student's ID : ";
cin.getline(st1,20);
system("cls");
ifstream intf("student.txt",ios::binary);
intf.read((char*)this,sizeof(*this));
cont=0;
while(!intf.eof())
{
for(i=0;sc1[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc1[i];i++);
if(sc1[i]=='\0'&&st1[i]=='\0')
{
cont++;
if(cont==1)
{
cout<<"\n\t\t->The Details Are --------->\n";
cout<<"\n\t\tStudent Name : "<<auname;
cout<<"\n\t\tStudent's ID : "<<sc1;
}
cout<<"\n\n\t\t******* "<<cont<<". Book Details *******\n";
cout<<"\n\t\tBook Name : "<<bookname;
cout<<"\n\t\tBook's ID : "<<sc; cout<<"\n\t\
tDate : "<<q<<"/"<<B<<"/"<<p<<"\n";
}
intf.read((char*)this,sizeof(*this));
}
intf.close();
if(cont==0)
cout<<"\n\t\tNo Record Found ..........";
}
else if(i==4)
{
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details ---------->\n";
cout<<"\n\n\t\tEnter Student's ID : ";
cin.getline(st,50);
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,20);
fstream intf("student.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this)); while(!
intf.eof())
{
for(i=0;sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[i];i++);
for(j=0;sc1[j]!='\0'&&st[j]!='\0'&&st[j]==sc1[j];j++);
if(sc[i]=='\0'&&sc1[j]=='\0'&&st[j]=='\0'&&st1[i]=='\0')
{
d=q;
m=B;
y=p;
cout<<"\n\t\tEnter New Date : ";
cin>>q>>B>>p;
fine(d,m,y,q,B,p); //fn1
intf.seekp(intf.tellp()-=sizeof(*this)); //fn3
intf.write((char*)this,sizeof(*this)); //fn5
cout<<"\n\n\t\tReissued successfully......."; //fn3
break;
}
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else if(i==5)
{
system("cls");
b=branch(2);
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details -------->\n";
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,20);
der(st1,b,2);
cout<<"\n\n\t\tEnter Student's ID : ";
cin.getline(st,20);
cout<<"\n\t\tEnter Present date : ";
cin>>d>>m>>y;
ofstream outf("temp.txt",ios::app|ios::binary);
ifstream intf("student.txt",ios::binary);
intf.read((char*)this,sizeof(*this)); while(!
intf.eof())
{
for(i=0;sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[i];i++);
for(j=0;sc1[j]!='\0'&&st[j]!='\0'&&st[j]==sc1[j];j++);
if(sc[i]=='\0'&&sc1[j]=='\0'&&st[j]=='\0'&&st1[i]=='\0'&&cont==0)
{
cont++;
intf.read((char*)this,sizeof(*this));
fine(q,B,p,d,m,y);
cout<<"\n\t\tReturned successfully. ..........";
}
else
{
outf.write((char*)this,sizeof(*this));
intf.read((char*)this,sizeof(*this));
}
}
intf.close();
outf.close();
getch();
remove("student.txt");
rename("temp.txt","student.txt");
}
else if(i==6)
{
system("cls");
librarian();
}
else
cout<<"\n\t\tWrong Input.\n";
}
void Lib::der(char st[],int b,int x)
{
int i,cont=0;
fstream intf("Booksdata.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this)); while(!
intf.eof())
{
for(i=0;b==B&&sc[i]!='\0'&&st[i]!='\0'&&st[i]==sc[i];i++);
if(sc[i]=='\0'&&st[i]=='\0')
{
cont++;
if(x==1)
{
q--;
}
else
{
q++;
}
intf.seekp(intf.tellp()-=sizeof(*this));
intf.write((char*)this,sizeof(*this));
break;
}
intf.read((char*)this,sizeof(*this));
}
if(cont==0)
{
cout<<"\n\t\tBook Not Found. ........\n";
cout<<"\n\n\t\tPress Any Key To Continue .......";
getch();
system("cls");
issue();
}
intf.close();
}
void Lib::get()
{
int i;
string UserName;
string UserPassword;
int LoginAttempt = 0;
else if(i==3)
exit(0);
else
{
cout<<"\n\t\tPlease Enter Correct Option :(";
getch();
system("CLS");
get();
}
}
void Lib::student()
{
int i;
Overall this project of ours is being developed to help the students as well as staff
of library to maintain the library in the best way possible and also reduce the
human efforts
Books and student maintenance modules are also included in this system which would
keep track of the students using the library and also a detailed description about the
books a library contains. With this computerized system there will be no loss of book
record or member record which generally happens when a non-computerized system is
used
Working of Program:
1. NORMAL USER
1.1 USER LOGIN
Description of
feature
This feature used by the user to login into system. They are required to enter user id
and password before they are allowed to enter the system. The user id and password
will be verified and if invalid id is there user is allowed to not enter the system.
Working
-user id is provided when they register
-The system must only allow user with valid id and password to enter the system
-The system performs authorization process which decides what user level can access to.
-The user must be able to logout after they finished using system.
Admin Features
Admin Dashboard
Admin can add/update/ delete category
Admin can add/update/ delete author
Admin can add/update/ delete books
Admin can issue a new book to student and also update the details
when student return book
Admin can search student by using their student ID
Admin can also view student details
Students-
• Student can register yourself and after registration they will get student
• After login student can view own dashboard.
• Student can update own profile.
• Student can view issued book and book return date-time.
2.3 SOFTWARE TOOLS USED
Here We have used the VS Code Editor to Type the code in C++ language using Object
Oriented Programming.
C++:
C++ is a cross-platform language that can be used to create high-
performance applications. C++ was developed by Bjarne Stroustrup, as an
extension to the C language. C++ gives programmers a high level of control over
system resources and memory.
Vs Code:
Visual Studio Code is a streamlined code editor with support
for development operations like debugging, task running, and
version control. It aims to provide just the tools a developer needs for
a quick code-build-debug cycle and leaves more complex workflows to
fuller featured IDEs, such as Visual Studio IDE.
Wikipedia:
Wikipedia is a free, open content online encyclopedia created through
the collaborative effort of a community of users known as Wikipedians.
Anyone registered on the site can create an article for publication;
registration is not required to edit articles.
Program Output:
Here’s the output of the program
Here it is used to login to the account so it takes the user name and
Password.
After Login you will get these options choose the options.
If you are student, then chose the option 1.
Here when we chose the option to view booklist then it takes us to Branch info.
There are again four options:
First is of computer,
Then there is Artificial intelligence, Mechanical, and Go to main menu.
Options and a choice to select any one.
After choosing computer from above list it will ask for the book name and will
show the author name and book info if the book is not available then it will not
show the name of author and it will show book not found massage Then it will
take us back to the welcome student.
It will ask the password to login to librarian account then it will take us to next
page.
After choosing the librarian option then it will take us to welcome librarian Then
it will ask for options like view booklist, search for a book, modify/add book,
issue book, go to main menu, and close application.
After choosing view booklist option, It will ask to select the branch then it will
take us to next page.
There are 4 options computer, Artificial Intelligence, Mechanical, and go to main
menu
After choosing the option in the given list you will get the lists of the books which
are present in the library.
There the user can see the Name of the book, author name, book id, and etc.
After choosing the search option then there will be two option then choose any
one of them to search by the name to search by book id
After choosing the options and after inserting the input you will get the output of
book found and the info of book and if the book is not available it will show book
not found and take you to the librarian page
After choosing issue book it will take you to this options it will show the following
options in the given figure.
After choosing to issue a book it will ask the following things to fill and then it will
shoe book issued successfully.
After choosing to view the issued books details it will show the following
information.
This option shows the students who checks the books on this system
• Management of time.
8. Reference:
9. Conclusion:
We understood about the concept of types of Classes pointers functions and etc. and
also we understand examples of it by team work.