SlideShare a Scribd company logo
Object Oriented Programming
Library Management System Project
Code for Program:
#include<iostream>
#include<conio.h>
#include<windows.h>
#include<string>
usingnamespace std;
staticint bookcount=0;
//***************************************************************************
// THIS CLASSCONTAINSFUNCTIONSRELATEDTO BOOKS
//***************************************************************************
classBookArchive
{
protected:
inti,j;
stringbookcode[100];
char name[100][50];
char author[100][50];
int quantity[100],price[100];
int issue[100];
BookArchive()
{
i=j=0;
}
public:
voidadd_books();
voidlist_of_books();
voidmodify_books();
voiddelete_books();
voidsearch_books();
voidissue_books();
voidreturn_books();
};
//***************************************************************************
// THIS CLASSCONTROLALL THE FUNCTIONSIN THE MENU
//***************************************************************************
//**********************************************************
// ClassisInheritedfrom"BookArchive"andhasa Relation
//**********************************************************
classLibrary : publicBookArchive
{
public:
voidintroduction()
{
system("cls");
cout<<"nnnttt WELCOME TO PROJECTn";
cout<<"tt LIBRARYMANAGEMENT PROGRAMFOR BOOKSnnn";
cout<<"tttThis Programhas Facilityof n";
cout<<"tttMaintaining Recordsof BOOKS.n";
cout<<"tttThis Program can HoldRecordn";
cout<<"tttof Hundered(100) Categoriesofn";
cout<<"tttBooks&can Store 10,000 Books.nnn";
cout<<"tt Let'sGet Started:-)n";
cout<<"tt Pressany keyto continue...";
getch();
}
voidmain_menu()
{
char ch;
while (1)
{
system("cls");
cout<<"nnttttMAIN MENUn";
cout<<"tttt~~~~~~~~~~~~nn";
cout<<"ttt1.Introductionnn";
cout<<"ttt2.View Booklistnn";
cout<<"ttt3.Add Booksnn";
cout<<"ttt4.Edit Menunn";
cout<<"ttt5.Search Booksnn";
cout<<"ttt6.Issue/ReturnBooksnn";
cout<<"ttt0.Close Applicationnnn";
cout<<"tttEnterYourChoice : " ;
cin>>ch;
switch(ch)
{
case '1':
introduction();
break;
case '2':
list_of_books();
break;
case '3':
add_books();
break;
case '4':
edit_menu();
break;
case '5':
search_books();
break;
case '6':
issue_return();
case '0':
{
system("cls");
cout<<"nnttThankYouForUsing the Programn";
cout<<"ttExitingin3second...........>nnn";
Sleep(3000);
exit(0);
}
break;
default:
{
cout<<"tttaaWrongEntry!!n";
cout<<"tttPleaseEnterCorrectOption";
if(getch())
main_menu();
}
}
}
}
protected:
voidedit_menu()
{
char ch;
while (1)
{
system("cls");
cout <<"nnttttEDITBOOKSn";
cout <<"tttt~~~~~~~~~~~~nn" ;
cout <<"ttt1. Modifyn";
cout <<"ttt2. Deleten";
cout <<"ttt0. Main Menunn";
cout <<"tttEnterYour Choice :" ;
cin>>ch;
switch(ch)
{
case '1':
modify_books();
break;
case '2':
delete_books();
break;
case '0':
main_menu();
break;
default:
{
cout<<"tttaaWrongEntry!!n";
cout<<"tttPleaseEnterCorrectOption";
if(getch())
edit_menu();
}
}
}
}
voidissue_return()
{
char ch1;
while (1)
{
system("cls");
cout <<"nnttttISSUE/RETURN BOOKSn";
cout <<"tttt~~~~~~~~~~~~~~~~~~nn" ;
cout <<"ttt1. Issue Booksn";
cout <<"ttt2. ReturnBooksn";
cout <<"ttt0. Main Menunn";
cout <<"tttEnterYour Choice :" ;
cin>>ch1;
switch(ch1)
{
case '1':
issue_books();
break;
case '2':
return_books();
break;
case '0':
main_menu();
break;
default:
{
cout<<"tttaaWrongEntry!!n";
cout<<"tttPleaseEnterCorrectOption";
if(getch())
issue_return();
}
}
}
}
};
//***************************************************************************
// DEFINITIONSOFFUNCTIONSUSED IN CLASS"BookArchive"
//***************************************************************************
//*****************************
// FunctionToAddBooks
//*****************************
voidBookArchive::add_books()
{
char choice;
do
{
system("cls");
cin.ignore();
cout<<"tADD BOOKSTO LIBRARY";
cout<<"nNEWBOOK ENTRY...";
cout<<"nnEnterBookCode:";
getline(cin,bookcode[bookcount]);
cout<<"Enter Name of Book: ";
gets(name[bookcount]);
cout<<"Enter Author'sName:";
gets(author[bookcount]);
cout<<"Enter Price:";
cin>>(price[bookcount]);
cout<<"Enter Quantity:";
cin>>(quantity[bookcount]);
cout<<"nnBOOKCREATED!!";
issue[bookcount]=0;
bookcount++;
cout<<"nnEnterAnotherBook?(y/n):";
cin>>choice;
}
while (choice=='Y'||choice=='y');
cout<<"Pressany keyto go back to Main Menu...";
getch();
}
//*****************************
// FunctionToShowBooksList
//*****************************
voidBookArchive::list_of_books()
{
system("cls");
cout<<"tLIST OF ALL LIBRARYBOOKS";
for(i=0; i<bookcount; i++)
{
cout<<endl<<endl;
cout<<"Book Code:";
cout<<(bookcode[i])<<endl;
cout<<"Book Name:";
puts(name[i]);
cout<<"AuthorName:";
puts(author[i]);
cout<<"Price:"<<price[i]<<endl;
cout<<"Quantity:"<<quantity[i]<<endl<<endl;
}
if(i==0)
cout<<"nNoBookRecord.nn";
cout<<"Pressany keytogo back to Main Menu...";
getch();
}
//*****************************
// FunctionToModifyBooks
//*****************************
voidBookArchive::modify_books()
{
char choice;
stringbk_nmbr;
do
{
system("cls");
cin.ignore();
cout<<"tBOOKMODIFYING PANELnn";
cout<<"Enter BookCode to Modify:";
getline(cin,bk_nmbr);
cout<<"Searching....n";
Sleep(5000);
for(i=0; i<bookcount; i++)
if(bk_nmbr==bookcode[i])
{
cout<<"ntBOOKRECORDFOUND!!nn";
cout<<"AddModifyingDetailsn";
cout<<"Enter BookCode:";
getline(cin,bookcode[i]);
cout<<"Enter Name of Book: ";
gets(name[i]);
cout<<"Enter Author'sName:";
gets(author[i]);
cout<<"Enter Price:";
cin>>(price[i]);
cout<<"Enter Quantity:";
cin>>(quantity[i]);
cout<<"nnBookwithCode '"<<bookcode[i]<<"'hasbeenModified..";
break;
}
if(i==bookcount)
cout<<"nnNoSuchBookRecord isFound.";
cout<<"nModifyAnotherBook?(y/n):";
cin>>choice;
}
while (choice=='y'||choice=='Y');
cout<<"Pressany keytogo back to Edit Menu...";
getch();
}
//*****************************
// FunctionToDelete Books
//*****************************
voidBookArchive::delete_books()
{
char choice;
stringbk_nmbr;
do
{
system("cls");
cin.ignore();
cout<<"tBOOKDELETING PANELnn";
cout<<"Enter BookCode to be Deleted:";
getline(cin,bk_nmbr);
cout<<"Searching....n";
Sleep(5000);
for(i=0; i<bookcount; i++)
if(bk_nmbr==bookcode[i])
{
cout<<"ntBOOKRECORDFOUND!!nn";
for(j=i ; j<bookcount;j++)
{
issue[j]=issue[j+1];
bookcode[j]=bookcode[j+1];
strcpy(name[j],name[j+1]);
strcpy(author[j],author[j+1]);
price[j]=price[j+1];
quantity[j]=quantity[j+1];
}
bookcount-=1;
cout<<"nnnBookRecordDeletedSuccessfully...n";
break;
}
if(i==bookcount)
cout<<"nnNoSuchBookRecord isFound.";
cout<<"nDelete AnotherBook?(y/n):";
cin>>choice;
}
while(choice=='y'||choice=='Y');
cout<<"Pressany keytogo back to Edit Menu...";
getch();
}
//*****************************
// FunctionToSearch Books
//*****************************
voidBookArchive::search_books()
{
char choice;
stringbk_nmbr;
do
{
system("cls");
cin.ignore();
cout<<"tBOOKSEARCHINGPANELnn";
cout<<"Enter BookCode to Search:";
getline(cin,bk_nmbr);
cout<<"Searching....n";
Sleep(5000);
for(i=0; i<bookcount; i++)
if(bk_nmbr==bookcode[i])
{
cout<<"ntBOOKRECORDFOUND!!nn";
cout<<"Complete BookDetailsn";
cout<<"Book Code:";
cout<<(bookcode[i])<<endl;
cout<<"Book Name:";
puts(name[i]);
cout<<"AuthorName:";
puts(author[i]);
cout<<"Price:"<<price[i]<<endl;
cout<<"Quantity:"<<quantity[i]<<endl;
break;
}
if(i==bookcount)
cout<<"nnNoSuchBookRecord isFound.";
cout<<"nSearchAnotherBook?(y/n):";
cin>>choice;
}
while (choice=='y'||choice=='Y');
cout<<"Pressany keytogo back to Main Menu...";
getch();
}
//*****************************
// FunctionToIssue Books
//*****************************
voidBookArchive::issue_books()
{
char choice,choice1;
stringbk_nmbr;
do
{
system("cls");
cin.ignore();
cout<<"tBOOKISSUINGPANELnn";
cout<<"Enter BookCode to Issue:";
getline(cin,bk_nmbr);
cout<<"Searching....n";
Sleep(5000);
for(i=0; i<bookcount; i++)
if(bk_nmbr==bookcode[i])
{
cout<<"ntBOOKRECORDFOUND!!nn";
cout<<"Complete BookDetailsn";
cout<<"Book Code:";
cout<<(bookcode[i])<<endl;
cout<<"Book Name:";
puts(name[i]);
cout<<"AuthorName:";
puts(author[i]);
cout<<"Price:"<<price[i]<<endl;
cout<<"Quantity:"<<quantity[i]<<endl<<endl;
if (quantity[i]>0)
{
cout<<"Do You Want to Issue ThisBook?(y/n):";
cin>>choice1;
if (choice=='y'|| choice=='Y')
issue[i]==1;
quantity[i]--;
cout<<"nBookwithCode '"<<bookcode[i]<<"'isIssuedn";
}
else
{
cout<<"ThisBook isOut of Stockn";
}
break;
}
if(i==bookcount)
cout<<"nnNoSuchBookRecord isFound.n";
cout<<"nSearchAnotherBook?(y/n):";
cin>>choice;
}
while (choice=='y'||choice=='Y');
cout<<"Pressany keytogo back to Issue/ReturnMenu...";
getch();
}
//*****************************
// FunctionToReturnBooks
//*****************************
voidBookArchive::return_books()
{
char choice,choice1;
stringbk_nmbr;
do
{
system("cls");
cin.ignore();
cout<<"tBOOKRETURNING PANELnn";
cout<<"Enter BookCode to Return:";
getline(cin,bk_nmbr);
cout<<"Searching....n";
Sleep(5000);
for(i=0; i<bookcount; i++)
if(bk_nmbr==bookcode[i])
{
cout<<"ntBOOKRECORDFOUND!!nn";
cout<<"Complete BookDetailsn";
cout<<"Book Code:";
cout<<(bookcode[i])<<endl;
cout<<"Book Name:";
puts(name[i]);
cout<<"AuthorName:";
puts(author[i]);
cout<<"Price:"<<price[i]<<endl;
cout<<"Quantity:"<<quantity[i]<<endl<<endl;
cout<<"Do You Want to ReturnThisBook?(y/n):";
cin>>choice1;
if (choice=='y'|| choice=='Y')
issue[i]==0;
quantity[i]++;
cout<<"nBookwithCode '"<<bookcode[i]<<"'hasbeenReturnedn";
break;
}
if(i==bookcount)
cout<<"nnNoSuchBookRecord isFound.n";
cout<<"nSearchAnotherBook?(y/n):";
cin>>choice;
}
while (choice=='y'||choice=='Y');
cout<<"Pressany keytogo back to Issue/Return Menu...";
getch();
}
//***************************************************************************
// PROGRAMEXECUTION THROUGH "MAIN"FUNCTION
//***************************************************************************
intmain()
{
LibraryL;
L.introduction();
L.main_menu();
}
OUTPUT:
Library Managment System - C++ Program

More Related Content

DOC
Library Management System in c++
PDF
Deep Learning (DL) from Scratch
PDF
Efficient Use of indexes in MySQL
PDF
Python GUI
PPT
Advanced JavaScript
PDF
Tkinter_GUI_Programming_in_Python.pdf
PDF
UseCase is a DIALOG---NOT a PROCESS
PPTX
PostgreSQL- An Introduction
Library Management System in c++
Deep Learning (DL) from Scratch
Efficient Use of indexes in MySQL
Python GUI
Advanced JavaScript
Tkinter_GUI_Programming_in_Python.pdf
UseCase is a DIALOG---NOT a PROCESS
PostgreSQL- An Introduction

What's hot (20)

PDF
Mvcc in postgreSQL 권건우
KEY
Clean Code
PPSX
Kotlin Language powerpoint show file
PDF
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
PDF
Flutter State Management - Moti Bartov, Tikal
PPT
SQLITE Android
PDF
Flutter bus 2018
PDF
Python Programming Language | Python Classes | Python Tutorial | Python Train...
PPTX
C++ GUI 라이브러리 소개: Qt & Nana
PDF
PostgreSQL Deep Internal
PDF
Declarative UIs with Jetpack Compose
PDF
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
PPTX
Introduction to java
PDF
Kotlin delegates in practice - Kotlin Everywhere Stockholm
PPTX
Dictionaries and Sets
PDF
Try Jetpack Compose
PDF
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
PPT
JavaScript - Part-1
PDF
SQL injection: Not Only AND 1=1 (updated)
PDF
Ad hoc Polymorphism using Type Classes and Cats
Mvcc in postgreSQL 권건우
Clean Code
Kotlin Language powerpoint show file
[JCConf 2023] 從 Kotlin Multiplatform 到 Compose Multiplatform:在多平台間輕鬆共用業務邏輯與 U...
Flutter State Management - Moti Bartov, Tikal
SQLITE Android
Flutter bus 2018
Python Programming Language | Python Classes | Python Tutorial | Python Train...
C++ GUI 라이브러리 소개: Qt & Nana
PostgreSQL Deep Internal
Declarative UIs with Jetpack Compose
LetSwift 2017 - 토스 iOS 앱의 개발/배포 환경
Introduction to java
Kotlin delegates in practice - Kotlin Everywhere Stockholm
Dictionaries and Sets
Try Jetpack Compose
Akka.NET 으로 만드는 온라인 게임 서버 (NDC2016)
JavaScript - Part-1
SQL injection: Not Only AND 1=1 (updated)
Ad hoc Polymorphism using Type Classes and Cats
Ad

Similar to Library Managment System - C++ Program (20)

DOCX
Supermarket
DOCX
Web Scripting Project JavaScripts and HTML WebPage
DOC
Project hotel on hotel management fo
DOC
Quiz using C++
PDF
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
DOCX
Project fast food automaton
DOCX
computer project on shopping mall..cbse 2017-2018 project
DOCX
Week 2 - Advanced C++list1.txt312220131197.docx
TXT
c++ project on restaurant billing
DOCX
C# labprograms
DOCX
(C++ programming)menu quit, book show, book change, book remo.docx
PDF
(In java language)1. Use recursion in implementing the binarySearc.pdf
PDF
General Functions
DOCX
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
DOCX
Conexion php
DOCX
Conexion php
PDF
API Design
DOCX
Implementation of k-means clustering algorithm in C
DOCX
Tugas praktikukm pemrograman c++
PDF
A single language for backend and frontend from AngularJS to cloud with Clau...
Supermarket
Web Scripting Project JavaScripts and HTML WebPage
Project hotel on hotel management fo
Quiz using C++
g++ -o simpleVector.exe simpleVector.cpp #include stdio.h #i.pdf
Project fast food automaton
computer project on shopping mall..cbse 2017-2018 project
Week 2 - Advanced C++list1.txt312220131197.docx
c++ project on restaurant billing
C# labprograms
(C++ programming)menu quit, book show, book change, book remo.docx
(In java language)1. Use recursion in implementing the binarySearc.pdf
General Functions
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
Conexion php
Conexion php
API Design
Implementation of k-means clustering algorithm in C
Tugas praktikukm pemrograman c++
A single language for backend and frontend from AngularJS to cloud with Clau...
Ad

More from Muhammad Danish Badar (8)

DOCX
Water and marketing needs, wants & demands
DOCX
Vocabulary builiding strategy
DOCX
Napoleon Bonaparte
DOCX
Graphs and eularian circuit & path with c++ program
PPT
Differences Between British English and American English
DOCX
Alexander the great
DOCX
Adolf hitler
DOCX
Comparison between computers of past and present
Water and marketing needs, wants & demands
Vocabulary builiding strategy
Napoleon Bonaparte
Graphs and eularian circuit & path with c++ program
Differences Between British English and American English
Alexander the great
Adolf hitler
Comparison between computers of past and present

Recently uploaded (20)

PDF
Insiders guide to clinical Medicine.pdf
PPTX
Institutional Correction lecture only . . .
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Lesson notes of climatology university.
PPTX
Pharma ospi slides which help in ospi learning
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
master seminar digital applications in india
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Cell Types and Its function , kingdom of life
PDF
RMMM.pdf make it easy to upload and study
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Insiders guide to clinical Medicine.pdf
Institutional Correction lecture only . . .
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
VCE English Exam - Section C Student Revision Booklet
Lesson notes of climatology university.
Pharma ospi slides which help in ospi learning
2.FourierTransform-ShortQuestionswithAnswers.pdf
Sports Quiz easy sports quiz sports quiz
master seminar digital applications in india
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Final Presentation General Medicine 03-08-2024.pptx
Microbial diseases, their pathogenesis and prophylaxis
Supply Chain Operations Speaking Notes -ICLT Program
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Cell Types and Its function , kingdom of life
RMMM.pdf make it easy to upload and study
O5-L3 Freight Transport Ops (International) V1.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student

Library Managment System - C++ Program

  • 1. Object Oriented Programming Library Management System Project Code for Program: #include<iostream> #include<conio.h> #include<windows.h> #include<string> usingnamespace std; staticint bookcount=0; //*************************************************************************** // THIS CLASSCONTAINSFUNCTIONSRELATEDTO BOOKS //*************************************************************************** classBookArchive { protected: inti,j; stringbookcode[100]; char name[100][50]; char author[100][50]; int quantity[100],price[100]; int issue[100]; BookArchive() { i=j=0; } public: voidadd_books(); voidlist_of_books(); voidmodify_books(); voiddelete_books(); voidsearch_books(); voidissue_books(); voidreturn_books(); }; //*************************************************************************** // THIS CLASSCONTROLALL THE FUNCTIONSIN THE MENU //*************************************************************************** //********************************************************** // ClassisInheritedfrom"BookArchive"andhasa Relation //********************************************************** classLibrary : publicBookArchive
  • 2. { public: voidintroduction() { system("cls"); cout<<"nnnttt WELCOME TO PROJECTn"; cout<<"tt LIBRARYMANAGEMENT PROGRAMFOR BOOKSnnn"; cout<<"tttThis Programhas Facilityof n"; cout<<"tttMaintaining Recordsof BOOKS.n"; cout<<"tttThis Program can HoldRecordn"; cout<<"tttof Hundered(100) Categoriesofn"; cout<<"tttBooks&can Store 10,000 Books.nnn"; cout<<"tt Let'sGet Started:-)n"; cout<<"tt Pressany keyto continue..."; getch(); } voidmain_menu() { char ch; while (1) { system("cls"); cout<<"nnttttMAIN MENUn"; cout<<"tttt~~~~~~~~~~~~nn"; cout<<"ttt1.Introductionnn"; cout<<"ttt2.View Booklistnn"; cout<<"ttt3.Add Booksnn"; cout<<"ttt4.Edit Menunn"; cout<<"ttt5.Search Booksnn"; cout<<"ttt6.Issue/ReturnBooksnn"; cout<<"ttt0.Close Applicationnnn"; cout<<"tttEnterYourChoice : " ; cin>>ch; switch(ch) { case '1': introduction(); break; case '2': list_of_books(); break; case '3': add_books(); break; case '4': edit_menu(); break; case '5': search_books(); break; case '6': issue_return(); case '0': { system("cls"); cout<<"nnttThankYouForUsing the Programn"; cout<<"ttExitingin3second...........>nnn";
  • 3. Sleep(3000); exit(0); } break; default: { cout<<"tttaaWrongEntry!!n"; cout<<"tttPleaseEnterCorrectOption"; if(getch()) main_menu(); } } } } protected: voidedit_menu() { char ch; while (1) { system("cls"); cout <<"nnttttEDITBOOKSn"; cout <<"tttt~~~~~~~~~~~~nn" ; cout <<"ttt1. Modifyn"; cout <<"ttt2. Deleten"; cout <<"ttt0. Main Menunn"; cout <<"tttEnterYour Choice :" ; cin>>ch; switch(ch) { case '1': modify_books(); break; case '2': delete_books(); break; case '0': main_menu(); break; default: { cout<<"tttaaWrongEntry!!n"; cout<<"tttPleaseEnterCorrectOption"; if(getch()) edit_menu(); } } } } voidissue_return() { char ch1; while (1) { system("cls"); cout <<"nnttttISSUE/RETURN BOOKSn"; cout <<"tttt~~~~~~~~~~~~~~~~~~nn" ;
  • 4. cout <<"ttt1. Issue Booksn"; cout <<"ttt2. ReturnBooksn"; cout <<"ttt0. Main Menunn"; cout <<"tttEnterYour Choice :" ; cin>>ch1; switch(ch1) { case '1': issue_books(); break; case '2': return_books(); break; case '0': main_menu(); break; default: { cout<<"tttaaWrongEntry!!n"; cout<<"tttPleaseEnterCorrectOption"; if(getch()) issue_return(); } } } } }; //*************************************************************************** // DEFINITIONSOFFUNCTIONSUSED IN CLASS"BookArchive" //*************************************************************************** //***************************** // FunctionToAddBooks //***************************** voidBookArchive::add_books() { char choice; do { system("cls"); cin.ignore(); cout<<"tADD BOOKSTO LIBRARY"; cout<<"nNEWBOOK ENTRY..."; cout<<"nnEnterBookCode:"; getline(cin,bookcode[bookcount]); cout<<"Enter Name of Book: "; gets(name[bookcount]); cout<<"Enter Author'sName:"; gets(author[bookcount]); cout<<"Enter Price:"; cin>>(price[bookcount]); cout<<"Enter Quantity:"; cin>>(quantity[bookcount]);
  • 5. cout<<"nnBOOKCREATED!!"; issue[bookcount]=0; bookcount++; cout<<"nnEnterAnotherBook?(y/n):"; cin>>choice; } while (choice=='Y'||choice=='y'); cout<<"Pressany keyto go back to Main Menu..."; getch(); } //***************************** // FunctionToShowBooksList //***************************** voidBookArchive::list_of_books() { system("cls"); cout<<"tLIST OF ALL LIBRARYBOOKS"; for(i=0; i<bookcount; i++) { cout<<endl<<endl; cout<<"Book Code:"; cout<<(bookcode[i])<<endl; cout<<"Book Name:"; puts(name[i]); cout<<"AuthorName:"; puts(author[i]); cout<<"Price:"<<price[i]<<endl; cout<<"Quantity:"<<quantity[i]<<endl<<endl; } if(i==0) cout<<"nNoBookRecord.nn"; cout<<"Pressany keytogo back to Main Menu..."; getch(); } //***************************** // FunctionToModifyBooks //***************************** voidBookArchive::modify_books() { char choice; stringbk_nmbr; do { system("cls"); cin.ignore(); cout<<"tBOOKMODIFYING PANELnn"; cout<<"Enter BookCode to Modify:"; getline(cin,bk_nmbr); cout<<"Searching....n"; Sleep(5000); for(i=0; i<bookcount; i++) if(bk_nmbr==bookcode[i]) {
  • 6. cout<<"ntBOOKRECORDFOUND!!nn"; cout<<"AddModifyingDetailsn"; cout<<"Enter BookCode:"; getline(cin,bookcode[i]); cout<<"Enter Name of Book: "; gets(name[i]); cout<<"Enter Author'sName:"; gets(author[i]); cout<<"Enter Price:"; cin>>(price[i]); cout<<"Enter Quantity:"; cin>>(quantity[i]); cout<<"nnBookwithCode '"<<bookcode[i]<<"'hasbeenModified.."; break; } if(i==bookcount) cout<<"nnNoSuchBookRecord isFound."; cout<<"nModifyAnotherBook?(y/n):"; cin>>choice; } while (choice=='y'||choice=='Y'); cout<<"Pressany keytogo back to Edit Menu..."; getch(); } //***************************** // FunctionToDelete Books //***************************** voidBookArchive::delete_books() { char choice; stringbk_nmbr; do { system("cls"); cin.ignore(); cout<<"tBOOKDELETING PANELnn"; cout<<"Enter BookCode to be Deleted:"; getline(cin,bk_nmbr); cout<<"Searching....n"; Sleep(5000); for(i=0; i<bookcount; i++) if(bk_nmbr==bookcode[i]) { cout<<"ntBOOKRECORDFOUND!!nn"; for(j=i ; j<bookcount;j++) { issue[j]=issue[j+1]; bookcode[j]=bookcode[j+1]; strcpy(name[j],name[j+1]); strcpy(author[j],author[j+1]); price[j]=price[j+1]; quantity[j]=quantity[j+1]; } bookcount-=1;
  • 7. cout<<"nnnBookRecordDeletedSuccessfully...n"; break; } if(i==bookcount) cout<<"nnNoSuchBookRecord isFound."; cout<<"nDelete AnotherBook?(y/n):"; cin>>choice; } while(choice=='y'||choice=='Y'); cout<<"Pressany keytogo back to Edit Menu..."; getch(); } //***************************** // FunctionToSearch Books //***************************** voidBookArchive::search_books() { char choice; stringbk_nmbr; do { system("cls"); cin.ignore(); cout<<"tBOOKSEARCHINGPANELnn"; cout<<"Enter BookCode to Search:"; getline(cin,bk_nmbr); cout<<"Searching....n"; Sleep(5000); for(i=0; i<bookcount; i++) if(bk_nmbr==bookcode[i]) { cout<<"ntBOOKRECORDFOUND!!nn"; cout<<"Complete BookDetailsn"; cout<<"Book Code:"; cout<<(bookcode[i])<<endl; cout<<"Book Name:"; puts(name[i]); cout<<"AuthorName:"; puts(author[i]); cout<<"Price:"<<price[i]<<endl; cout<<"Quantity:"<<quantity[i]<<endl; break; } if(i==bookcount) cout<<"nnNoSuchBookRecord isFound."; cout<<"nSearchAnotherBook?(y/n):"; cin>>choice; } while (choice=='y'||choice=='Y'); cout<<"Pressany keytogo back to Main Menu..."; getch(); } //*****************************
  • 8. // FunctionToIssue Books //***************************** voidBookArchive::issue_books() { char choice,choice1; stringbk_nmbr; do { system("cls"); cin.ignore(); cout<<"tBOOKISSUINGPANELnn"; cout<<"Enter BookCode to Issue:"; getline(cin,bk_nmbr); cout<<"Searching....n"; Sleep(5000); for(i=0; i<bookcount; i++) if(bk_nmbr==bookcode[i]) { cout<<"ntBOOKRECORDFOUND!!nn"; cout<<"Complete BookDetailsn"; cout<<"Book Code:"; cout<<(bookcode[i])<<endl; cout<<"Book Name:"; puts(name[i]); cout<<"AuthorName:"; puts(author[i]); cout<<"Price:"<<price[i]<<endl; cout<<"Quantity:"<<quantity[i]<<endl<<endl; if (quantity[i]>0) { cout<<"Do You Want to Issue ThisBook?(y/n):"; cin>>choice1; if (choice=='y'|| choice=='Y') issue[i]==1; quantity[i]--; cout<<"nBookwithCode '"<<bookcode[i]<<"'isIssuedn"; } else { cout<<"ThisBook isOut of Stockn"; } break; } if(i==bookcount) cout<<"nnNoSuchBookRecord isFound.n"; cout<<"nSearchAnotherBook?(y/n):"; cin>>choice; } while (choice=='y'||choice=='Y'); cout<<"Pressany keytogo back to Issue/ReturnMenu..."; getch(); } //***************************** // FunctionToReturnBooks //*****************************
  • 9. voidBookArchive::return_books() { char choice,choice1; stringbk_nmbr; do { system("cls"); cin.ignore(); cout<<"tBOOKRETURNING PANELnn"; cout<<"Enter BookCode to Return:"; getline(cin,bk_nmbr); cout<<"Searching....n"; Sleep(5000); for(i=0; i<bookcount; i++) if(bk_nmbr==bookcode[i]) { cout<<"ntBOOKRECORDFOUND!!nn"; cout<<"Complete BookDetailsn"; cout<<"Book Code:"; cout<<(bookcode[i])<<endl; cout<<"Book Name:"; puts(name[i]); cout<<"AuthorName:"; puts(author[i]); cout<<"Price:"<<price[i]<<endl; cout<<"Quantity:"<<quantity[i]<<endl<<endl; cout<<"Do You Want to ReturnThisBook?(y/n):"; cin>>choice1; if (choice=='y'|| choice=='Y') issue[i]==0; quantity[i]++; cout<<"nBookwithCode '"<<bookcode[i]<<"'hasbeenReturnedn"; break; } if(i==bookcount) cout<<"nnNoSuchBookRecord isFound.n"; cout<<"nSearchAnotherBook?(y/n):"; cin>>choice; } while (choice=='y'||choice=='Y'); cout<<"Pressany keytogo back to Issue/Return Menu..."; getch(); } //*************************************************************************** // PROGRAMEXECUTION THROUGH "MAIN"FUNCTION //*************************************************************************** intmain() { LibraryL; L.introduction(); L.main_menu(); }