Object oriented programming
project report
Library Management System
Group members
MADHIRE PAVITHRA(2020IMT-052)
PAMBA VAMSHI KRISHNA(2020IMT-066)
PRINCE MANN(2020IMT-073)
PRITHVI SINGH DANGAS(2020IMT-074)
SHRIYANSHU SHRIVASTAVA(2020IMT-096)
under the supervision of
Dr. VINAL PATEl
STUDENT’S DECLARATION
We hereby certify that we have properly checked and verified all the items as
prescribed in the check-list and ensure that our project/report is in proper format
as specified in the guideline for thesis preparation.
We understand that plagiarism involves an intentional act by the plagiarist of
using some- one else‘s work/ideas completely/partially and claiming
authorship/originality of the work/ideas. Verbatim copy as well as close
resemblance to some else‘s work constitute plagiarism.
We affirm that no portion of our work is plagiarized, and the experiments and
results reported in the report/dissertation/thesis are not manipulated. In the
event of a com- plaint of plagiarism and the manipulation of the experiments and
results, we shall be fully responsible and answerable. Our faculty supervisor(s) will
not be responsible for the same.
Signature:
Madhire Pavithra(2020IMT-052)
Pamba Vamshi Krishna(2020IMT-066)
Prince Mann(2020IMT-073)
Prithvi Singh Dangas(2020IMT-074)
Shriyanshu Shrivastava(2020IMT-096)
Abstract
The library Management System is an application supporting a
librarian in managing a library.
❖ The system would provide basic set of features to add members,
books and manage check in specifications for the system based
on clients need.
❖ This system reduces manual work to a great extent and allows
smooth flow of library activities.
❖ This system helps both students and library manager.
❖ Below are the classes and data members we used in our project
❖ Id_authentication()
❖ Book_issue()
❖ Book_availability()
❖ Fine_and_payment()
❖ Request_to_vendor()
❖ Request()
❖ Complaints()
❖ Supply_back() and New_version()
Contents
❖Source code
❖Output
Source code:
#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
class Book {
private:
string isbn_no;//private variable
string topic;//private variable
string writer;//private variable
string version;//private variable
string publisher; //private variable
public:
//setters - these will assign user value tp private members
void setisbn_no(string a)
{
isbn_no = a;
}
void settopic(string b)
{
topic = b;
}
void setwriter(string c)
{
writer = c;
}
void setversion(string d)
{
version = d;
}
void setpublisher(string e)
{
publisher = e;
}
//getters - it gets the value from private members
string getisbn_no()
{
return isbn_no;
}
string gettopic()
{
return topic;
}
string getwriter()
{
return writer;
}
string getversion()
{
return version;
}
string getpublisher()
{
return publisher;
}
};
//initializing functions with counter as parameter
void addBook(int counter);
void deleteBook(int counter);
void editBook(int counter);
void searchBook(int counter);
void viewAllBooks(int counter);
void quit();
//counter for Book array
int counter=0;
//function for incrementing counter
void increment(int a){
a++;
counter=a;
}
//function for decrementing counter
void decrement(int a){
a--;
counter=a;
}
//Book class array initialization
Book books[10];
//main function
int main(){
string choice;
//Main Menu
system("cls");
cout<<"library management system\n\n";
cout<<"[1]add book\n";
cout<<"[2]delete book\n";
cout<<"[3]edit book\n";
cout<<"[4]search book\n";
cout<<"[5]view all books\n";
cout<<"[6]quit\n\n";
cout<<"enter choice: ";
getline(cin,choice);
system("cls");
if(choice=="1"){
addBook(counter); //function call
}
else if(choice=="2"){
deleteBook(counter); //function call
}
else if(choice=="3"){
editBook(counter); //function call
}
else if(choice=="4"){
searchBook(counter); //function call
}
else if(choice=="5"){
viewAllBooks(counter); //function call
}
else if(choice=="6"){
quit(); //function call
}
else{
main(); //function call to self(main)
}
_getch();
return 0;
}
//addBook function
void addBook(int counter){
string isbn_no,topic,writer,version,publisher;
cout<<"add book\n\n";
if(counter<10){
cout<<"enter isbn_no: ";
getline(cin,isbn_no); //getline - just like cin but includes white
spaces
cout<<"enter topic: ";
getline(cin,topic);
cout<<"enter writer: ";
getline(cin,writer);
cout<<"enter version: ";
getline(cin,version);
cout<<"enter publisher: ";
getline(cin,publisher);
books[counter].setisbn_no(isbn_no); //assigning the values
entered to book object
books[counter].settopic(topic);
books[counter].setwriter(writer);
books[counter].setversion(version);
books[counter].setpublisher(publisher);
increment(counter); //function called for increment
counter
cout<<"\nbook added successfully!\n\nPress any of the key to
continue ";
_getch();
main();
}
else{
cout<<"you have reached the maximum numberof book to be
added!\n\nPress any key to continue . . .";
_getch();
main();
}
}
//deleteBook function
void deleteBook(int counter)
{
string isbn_no;
int choice;
cout<<"delete book\n\n";
if(counter==0){
cout<<"ther is no book to delete!\n\nPress any key to continue
. . .";
_getch();
main();
}
cout<<"enter isbn_no: ";
getline(cin,isbn_no);
for(int i=0;i<counter;i++)
{
//finding a match using for loop
if(books[i].getisbn_no()==isbn_no){
cout<<"\nbook have been found\n\n";
cout<<"do you want to delete
this?\n[1]Yes\n[2]No\n\nEnter theChoice: ";
cin>>choice;
if(choice==1){
books[i].setisbn_no(""); //setting the value to
none
books[i].settopic("");
books[i].setwriter("");
books[i].setversion("");
books[i].setpublisher("");
for(int a=i;a<counter;a++){
// adjust the values upon deletion
books[a] = books[a+1];
}
books[9].setisbn_no(""); //adjustment if the
library is full(10 books)
books[9].settopic("");
books[9].setwriter("");
books[9].setversion("");
books[9].setpublisher("");
decrement(counter); //function called for
decrement counter
cout<<"\nBOOK HAS BEEN SUCCESSFULLY
DELETED!\n\nPress any key to continue";
_getch();
main();
}
else{
main();
}
}
}
cout<<"\nbook not found!\n\nPress any key to continue . . .";
_getch();
main();
}
void editBook(int counter){
system("cls");
string editisbn_no,choice;
string isbn_no,topic,writer,version,publisher;
cout<<"\nedit book\n\n";
if(counter==0){
cout<<"there is noy any book to edit!\n\nPress any key to
continue . . .";
_getch();
main();
}
cout<<"enter isbn_no: ";
getline(cin,editisbn_no);
for(int i=0;i<counter;i++){
//finding a match using for loop
if(books[i].getisbn_no()==editisbn_no){
cout<<"\nbook found!\n\n";
cout<<"isbn_no: "<<books[i].getisbn_no()<<endl;
cout<<"topic: "<<books[i].gettopic()<<endl;
cout<<"writer: "<<books[i].getwriter()<<endl;
cout<<"version: "<<books[i].getversion()<<endl;
cout<<"publisher: "<<books[i].getpublisher()<<endl;
cout<<"\ndo you want to edit?\n[1]Yes\n[2]No\n\n
Please Enter the choice: ";
getline(cin,choice);
if(choice=="1"){
//reenter the values
cout<<"enter isbn_no: ";
getline(cin,isbn_no);
cout<<"enter topic: ";
getline(cin,topic);
cout<<"enter writer: ";
getline(cin,writer);
cout<<"enter version: ";
getline(cin,version);
cout<<"enter publisher: ";
getline(cin,publisher);
books[i].setisbn_no(isbn_no);
books[i].settopic(topic);
books[i].setwriter(writer);
books[i].setversion(version);
books[i].setpublisher(publisher);
cout<<"\nbook has been edited
successfully!\n\nPress any key to continue . . .";
_getch();
editBook(counter);//function call to self
}
else{
main();
}
}
}
cout<<"\nbook not found!\n\nPress any key to continue . . .";
_getch();
main();
}
void searchBook(int counter){
string isbn_no;
int choice;
bool print = false; //boolean expression tosee which to print and
which to not
cout<<"search book\n\n";
if(counter==0){
cout<<"there is not any book to be searched!\n\nPress any key
to continue . . .";
_getch();
main();
}
cout<<"enter isbn_no: ";
getline(cin,isbn_no);
for(int i=0;i<counter;i++){
//finding a match using for loop
if(books[i].getisbn_no()==isbn_no){
cout<<"\nbook found!\n\n";
cout<<"isbn_no: "<<books[i].getisbn_no()<<endl;
cout<<"topic: "<<books[i].gettopic()<<endl;
cout<<"writer: "<<books[i].getwriter()<<endl;
cout<<"version: "<<books[i].getversion()<<endl;
cout<<"publisher: "<<books[i].getpublisher()<<endl;
print = true;
}
}
if(print){
cout<<"\n\nPress any key to continue ";
_getch();
main();
}
//if there's no book found
else{
cout<<"\nBOOK HAS NOT BEEN FOUND!\n\n please press any
of the key to continue . . .";
_getch();
main();
}
}
void viewAllBooks(int counter){
// using book array iterating the values on the library
cout<<"viewing all the books\n\n";
for(int i=0;i<counter;i++){
cout<<"details of the books\n\n";
cout<<"isbn_no: "<<books[i].getisbn_no()<<endl;
cout<<"topic: "<<books[i].gettopic()<<endl;
cout<<"writer: "<<books[i].getwriter()<<endl;
cout<<"version: "<<books[i].getversion()<<endl;
cout<<"publisher: "<<books[i].getpublisher()<<endl<<endl;
}
cout<<"Press any key to continue . . .";
_getch();
main();
}
void quit(){
//quit function
_exit(1);
}
Output:
This is the first slide after we enter into the program.
You will be having 6 choices , you can choose any one of the choice.
If you enter your choice as 1
You can add a book as shown below
If you enter your choice again as 1 you can add a book again as shown below
If you enter your choice as 2
You can delete a book which you have added
You can see the below slide
You can delete your book successfully.
If you enter your choice as 3
You can edit your book which you have added
You can see below slide
Your book has been successfully edited!
If you choose your option as 4
You can search your all added books
You can see the following slide
If you enter your option as 5
You can view all added books
You can see the below slide
At last
If you enter your choice as 6
You can exit out from the program.