0% found this document useful (0 votes)
13 views12 pages

Library Management System Project in C++

The document outlines a Library Management System project developed by a group of students at the National University of Modern Languages. The system, written in C++, facilitates library operations such as book management, user management, and transaction handling through a user-friendly menu-driven interface. It includes features for adding, searching, deleting, and displaying books, with a focus on minimizing human error and improving efficiency in library management.

Uploaded by

muqaddasmas8
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)
13 views12 pages

Library Management System Project in C++

The document outlines a Library Management System project developed by a group of students at the National University of Modern Languages. The system, written in C++, facilitates library operations such as book management, user management, and transaction handling through a user-friendly menu-driven interface. It includes features for adding, searching, deleting, and displaying books, with a focus on minimizing human error and improving efficiency in library management.

Uploaded by

muqaddasmas8
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

National University of Modern Languages

Programming Fundamentals
Project Based Learning
BSCE-I (Fall 2024)
Library Management System
Group Members:
Haleema Mushtaq (I-CE9244711)
Muqadas Masroor (I-CE9244732)
M. Irfan Khan Niazi (I-CE92447)
Farman Ullah (I-CE92447)
1
Library Management System Project
1. Introduction:

This project implements a Library Management System that facilitates efficient handling of
library operations such as book management, user management, issuing and returning books, and
keeping track of borrowed books. Written in C++, the program adopts a menu-driven approach
to ensure simplicity and user-friendliness.

2. Program Overview:

The Library Management System addresses the challenges librarians and library users face in
manually managing books and borrowing transactions. The software aims to minimize human
error and provide real-time access to the library's inventory. The program supports:

 Adding books to the library inventory.


 Adding available copies of existing books.
 Searching for books by ID, title, or author.
 Deleting books from the inventory.
 Displaying all books in the library.
 Exiting the system securely.
3. Application Domain and Customer Requirements:

Application Domain:

The Library Management System serves the domain of libraries in various environments such as
schools, colleges, universities, and public libraries. This domain includes the following
components:

 Book Inventory Management: Storing and retrieving books based on their unique IDs.
 User Management: Tracking the library members who can borrow and return books.
 Transaction Handling: Managing book issues and returns in a way that avoids conflicts or
errors.
 Accountability and Security: Ensuring each transaction (issue or return) is recorded,
promoting proper use of library resources.

2
Customer Requirements:

Functional Requirements:

 Add Book: Admins can add new books by providing a title, author, and unique ID.
 Add Available Book: Admins can update the quantity of an existing book in the inventory.
 Search a Book: Locate books using criteria like ID, title, or author.
 Delete a Book: Remove books permanently from the inventory.
 Display Books: List of all books along with their details.
 Exit: Safely terminate the program after all desired operations are completed.

Non-Functional Requirements:

 Usability: The system should have a simple interface with clear navigation options.
 Performance: Transactions should execute swiftly.
 Scalability: The program should allow expansion to support additional features such as
advanced search filters, due-date management, or fines.
 Reliability: The system should ensure no duplicate entries or transaction conflicts.

4. Methodology:

The Library Management System uses a procedural approach, guided by a sequential flow of
operations. Menu-driven navigation allows both librarians and users to interact with the system
effectively. Key modules include:

 Add Book Module: Handles the addition of new books to the inventory.
 Add Available Book Module: Updates the quantity of existing books.
 Search Book Module: Facilitates book searches by ID, title, or author.
 Delete Book Module: Validates and removes books from the system.
 Display Books Module: Lists all books with their details and availability status.
 Error Handling: Provides meaningful feedback for invalid inputs or actions, enhancing
reliability.
5. Flow Chart:

3
START

Display Main
Menu

Choose Action:

 Add Book
 Add Available Book
 Search a Book

 Delete a Book

 Display Books/ Exit

Execute
Selected
Action

Yes No

Return to Exit
Menu

STOP

4
6. Execution Code and Results:

Features Executed:

Add a Book:

Available Book:

Search a Book:

5
Delete a Book:

Exiting the system:

7. Conclusion:

The Library Management System demonstrates the fundamental operations of a library in a


computerized environment. The project showcases:

1. Effective use of programming fundamentals such as data structures (vectors).

2. Logical flow and modular coding practices.

3. Integration of basic validations to ensure consistency and reliability.

This system provides a solid foundation for further enhancement. Possible extensions include
integrating a database for persistent storage, implementing a graphical user interface (GUI), and

6
adding features like book reservations or fine management. Such improvements would bring the
system closer to meeting the real-world demands of modern libraries.

8. CODE:
#include <iostream>
#include <string>
using namespace std;
struct Book {
string title;
string author;
string publication;
int quantity;
};
Book books[100];
int bookCount = 0;
void addBook()
{
cout<<"\n=============== Add Book==============\n";
cout<<"Enter book title: ";
[Link]();
getline(cin, books[bookCount].title);
cout<<"Enter book author: ";
getline(cin, books[bookCount].author);
cout<<"Enter book publication: ";
getline(cin, books[bookCount].publication);
cout<<"Enter book quantity: ";
cin>>books[bookCount].quantity;

7
bookCount++;
cout<<"\n Book added successfully!\n"; cout<<"======================\n";
}
void displayBooks()
{
if (bookCount == 0)
{
cout<<"\n============ No Books Available============\n";
cout<<"No books available in the library.\n"; cout<<"==================\n";
return;
}
cout<<"\n============== Available Books============\n";
for (int i = 0; i < bookCount; i++)
{
cout<<"\n Book " << (i + 1) << ":\n";
cout<<"---------------------\n";
cout<<"Title: " << books[i].title << endl;
cout<<"Author: " << books[i].author << endl;
cout<<"Publication: " << books[i].publication << endl;
cout<<"Quantity: " << books[i].quantity << endl;
cout<<"---------------------\n";
}
cout<<"================\n";
}
void searchBook()
{
string title;

8
cout<<"\n============== Search Book===============\n";
cout<<"Enter book title to search: ";
[Link]();
getline(cin, title);
for (int i = 0; i < bookCount; i++)
{
if (books[i].title == title)
{
cout<<"\n Book found!\n";
cout<<"---------------------\n";
cout<<"Title: " << books[i].title<<endl;
cout<<"Author: " << books[i].author<<endl;
cout<<"Publication: " << books[i].publication<<endl;
cout<<"Quantity: " << books[i].quantity<<endl;
cout<<"-------------------\n";
return ;
}
}
cout<<"\n Book not found!\n"; cout<<"==================\n";
}
void deleteBook()
{
string title;
cout<<"\n============= Delete Book============\n";
cout<<"Enter book title to delete: ";
[Link]();
getline(cin, title);

9
for (int i = 0; i < bookCount; i++)
{
if (books[i].title == title)
{
for (int j = i; j < bookCount - 1; j++)
{
books[j] = books[j + 1];
}
bookCount--;
cout<<"\n Book deleted successfully!\n";
cout<<"================\n";
return;
}
}
cout<<"\n Book not found!\n";
cout<<"================\n";
}
int main()
{
int choice;
while (true)
{
cout<<"\n========= Library Management System========\n";
cout<<"1. Add Book\n";
cout<<"2. Display Books\n";
cout<<"3. Search Book\n";
cout<<"4. Delete Book\n";

10
cout<<"5. Exit\n";
cout<<"==================\n";
cout<<"Enter your choice: ";
cin>>choice;
switch (choice)
{
case 1:
addBook();
break;
case 2:
displayBooks();
break;
case 3:
searchBook();
break;
case 4:
deleteBook();
break;
case 5:
cout<<"\n Exiting the system\n";
return 0;
default:
cout<<"\n Invalid choice. Please try again.\n";
break;
}
}
return 0;}

11

Common questions

Powered by AI

The procedural approach in the Library Management System supports functionality and ease of use by organizing operations in a sequential flow. This method facilitates a menu-driven navigation, allowing users to systematically interact with functions such as adding, searching, and deleting books, which enhances usability and reduces complexity .

The current implementation of the Library Management System in C++ is basic, with plans for extending its scalability through potential enhancements like adding database support and GUI. Scalability remains limited in its current form, as it does not yet support features like complex search filters or fine management .

Error handling plays a critical role in the Library Management System by providing meaningful feedback for invalid inputs or actions. This feedback enhances system reliability by ensuring the user is informed of mistakes or invalid actions, which helps prevent data inconsistencies and ensures smooth operation .

The key modules of the Library Management System include the Add Book Module, Add Available Book Module, Search Book Module, Delete Book Module, and Display Books Module. These modules collectively fulfill the functional requirements by enabling book addition and inventory updates, searching and managing books, and displaying all current inventory, ensuring comprehensive book and user management .

The use of data structures such as vectors in the Library Management System enhances functionality by providing efficient storage and retrieval of book information. This solid foundation supports potential extensions like integrating databases and GUIs, which require structured and organized data handling .

Possible enhancements for the Library Management System include integrating a database for persistent storage, implementing a graphical user interface (GUI), and adding features like book reservations or fine management .

The Library Management System aims to address pitfalls such as human error, inefficiency in managing large volumes of books and transactions, and delays in providing real-time access to inventory data. By automating these tasks, the system ensures accuracy, timely updates, and streamlined operations .

The non-functional requirements include usability, performance, scalability, and reliability. Usability ensures a simple interface, performance is maintained with swift transaction execution, scalability allows future expansion, and reliability prevents duplicate entries and conflicts, collectively supporting efficient and secure library operations .

The menu-driven approach enhances user interaction and experience by simplifying navigation through clear and concise menu options. Users can easily choose actions such as adding or deleting books, searching the inventory, and exiting the program, which fosters an intuitive and efficient user experience .

The Library Management System ensures reliability by integrating basic validations to prevent duplicate entries and transaction conflicts, thus maintaining data consistency and preventing operational errors .

You might also like