Library Management System
Introduction
In this Library Management System project, you can enter the record of new books and retrieve the details of books available in the library. You can issue the books to the students and maintain their records. The main objective of the Library Management System is to manage the details of Library Books.
It manages all the information about Student Profiles and Books. Any library system’s main goal is to gather, store, organize, retrieve, and make information sources available to users. As a system, a library is a component of a larger system (an organization in any field, whether education, research or social service).
A library management system is a piece of software that keeps track of the library’s records. It provides information such as the number of books available in the library, the number of books issued, the number of books returned or renewed, and the record.
Objectives
The efficiency of both librarians and library customers is improved by a library management system. It also makes it simple for librarians to catalog books and maintain track of those that have been issued, reissued.
In this management system a student can only borrow 2 books maximum from a single ID.
Each student has unique ID. So, Each student can borrow maximum of 2 books.
Flow Chart
Pseudo Code
Initializing book names
Initializing checks variables
Initializing IDs data
Checking ID is correct or not
If ID is correct then giving options
Option1: Borrow Limit
Option2: Borrow Book
Option3: Change ID
Option4: Exit
Option 1 selected
Accessing IDs data and showing data
Back to options
Option 2 selected
Accessing IDs data and books names data
Selecting books
Updating library data
Back to options
Option 3 selected
Back to ID checks
Option 4 selected
Closing the program
Code
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
string BooksNames[9] = {"Calculus","Physics","Islamiat","ITCP","English","ODE","DLD","ECA","OOP"};
int ID,check=0,check1=0,IDs[4]={1,2,3,4};
int options,select,IDsLimits[4]={2,2,2,2};
//Main Loop
for(int i=0;i<=0;i--)
{
cout<<"Enter ID \n";
cin>>ID;
//ID Checking
for(int j=0;j<4;j++)
{if(ID!=IDs[j])
{check=1;
}
else
{check=0;
break;
}
}
if (check==1)
{cout<<"Wrong ID please Again ";
check=0;}
///Enter of ID Checking
else
//Library
{
//Library Loop
for(int k=0;k<=0;k--)
{
cout<<"Select Any Option\n";
cout<<"1. Limit of borrowing Books\n";
cout<<"2. Borrow Books\n";
cout<<"3. change ID\n";
cout<<"4. Exit\n";
cin>>options;
//Option 1
if(options==1)
{cout<<"Your Limit for Borrowing Books = "<<IDsLimits[ID-1]<<"\n"; }
//Option 2
else if(options==2)
{//ID check
if(IDsLimits[ID-1]!=0)
{cout<<"Books Names \n";
for(int l=0;l<9;l++)
{cout<<l+1<<". "<<BooksNames[l]<<"\n";}
cout<<"Select any Book\n";
cin>>select;
//Book Check
if(BooksNames[select-1]!="")
{BooksNames[select-1]="";
IDsLimits[ID-1]=IDsLimits[ID-1]-1;}
else
{cout<<"Book Already Borrowed\n";
}
//End of Book Check
}//End ID check
else
{cout<<"You are reach to your limit to borrow books\n";
}
}//End of Option 2
//Option 3
else if(options==3)
{break;
}
//Option 4
else if(options==4)
{
check1=1;
break;}
}//End of Library Loop
}//Library
if(check1==1)
{break;}
}//End of Main Loop
return 0;
}
Output
Selecting Book and checking borrow limit
Selecting 2nd Book and checking borrow limit
Book borrow limit reached
Changing ID and borrowing Book
Exiting Program
Comments
Post a Comment