0% found this document useful (0 votes)
12 views35 pages

Miniproject

The document outlines the design and implementation of a Library Management System (LMS) aimed at automating library operations such as book management, user management, and transaction processing. It details the system's objectives, requirements, architecture, and features, including a user-friendly interface and data storage methods. The LMS is built using C programming language and is intended to enhance efficiency and reduce errors in library management.

Uploaded by

Rakshit Katiyar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views35 pages

Miniproject

The document outlines the design and implementation of a Library Management System (LMS) aimed at automating library operations such as book management, user management, and transaction processing. It details the system's objectives, requirements, architecture, and features, including a user-friendly interface and data storage methods. The LMS is built using C programming language and is intended to enhance efficiency and reduce errors in library management.

Uploaded by

Rakshit Katiyar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Library Management System

Table of content
Table of content....................................................................................................................... 2
ACKNOWLEDGEMENT .............................................................................................................. 4
ABSTRACT .............................................................................................................................. 5
INTRODUCTION....................................................................................................................... 5
1.2 BACKGROUND OF PROJECT .............................................................................................. 7
1.3 Operation environment ..................................................................................................... 8
1. Hardware Requirements ............................................................................................... 8
2. Software Requirements ................................................................................................ 8
SYSTEM ANALYSIS ................................................................................................................... 9
2.1 SOFTWARE REQUIREMENT SPECIFICATION ......................................................................... 9
GENERAL DESCRIPTION ..................................................................................................... 9
2.1.1 SYSTEM OBJECTIVES ....................................................................................................10
2.1.2 SYSTEM REQUIREMENTS...............................................................................................10
System Architecture ................................................................................................................11
1. User Interface Layer.......................................................................................................11
2. Application Logic Layer ..................................................................................................11
3. Data Storage Layer ........................................................................................................11
Technologies Used ..................................................................................................................12
Features of the System ............................................................................................................13
Book Management ..........................................................................................................13

Student Management ......................................................................................................13

Book Issuing and Return...................................................................................................13

Data Storage and Retrieval ...............................................................................................13

Simple User Interface ......................................................................................................13


Library Management System

Page Structure and Layout........................................................................................................14


Main Menu.....................................................................................................................14
1.Add Book Submenu ...........................................................................................................14
2.Books List Submenu ..........................................................................................................15
3.Modify Book Submenu .......................................................................................................16
4.Issue Book Submenu .........................................................................................................17
5.Issued Books List Submenu ................................................................................................18
6.Delete Book Submenu........................................................................................................19
7.Exit Submenu ...................................................................................................................19
Source code...........................................................................................................................20
Future Enhancement ...............................................................................................................34
References ............................................................................................................................35
Library Management System

ACKNOWLEDGEMENT

We take this occasion to thank God, almighty for blessing us with his grace and taking our

endeavor to a successful culmination. We extend our sincere and heartfelt thanks to our esteemed

guide, Mr.Shaurab Prasadfor providing us with the right guidance and advice at the crucial junctures

and for showing me the right way. We extend our sincere thanks to our respected Head of the

department Dr.Sudhir Kr singh, for allowing us to use the facilities available. We would like to

thank the other faculty members also, at this occasion. Last but not the least, we would like to thank

our friends and family for the support and encouragement they have given us during the course of our

work.
Library Management System

ABSTRACT

A Library Management System (LMS) is a digital solution designed to efficiently manage and automate
library operations, including book cataloging, user management, borrowing, returning, and fine
calculation. This system aims to streamline administrative tasks, improve accessibility, and enhance the
overall user experience for both library staff and patrons.

The LMS provides a centralized database for storing book details, member records, and transaction
histories, ensuring quick retrieval and reduced manual errors. By integrating modern technologies, the
Library Management System optimizes resource utilization, minimizes paperwork, and enhances library
services, making it an essential tool for educational institutions, public libraries, and private
organizations.

INTRODUCTION

This chapter gives an overview about the aim, objectives, background and operation environment
of the system.
Library Management System

1.1 PROJECT AIMS AND OBJECTIVES


The project aims and objectives that will be achieved after completion of this project are discussed
in this subchapter. The aims and objectives are as follows:
• Online book issue
• Request column for librarian for providing new books
• A separate column for digital library
• Student login page where student can find books issued by him/her and date of return.
• A search column to search availability of books
• A teacher login page where teacher can add any events being organized in the
college and important suggestions regarding books.
• Online notice board about the workshop.
Library Management System

1.2 BACKGROUND OF PROJECT

Library Management System is an application which refers to library systems which are generally
small or medium in size. It is used by librarian to manage the library using a computerized system
where he/she can record various transactions like issue of books, return of books, addition of new
books, addition of new students etc.

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.

In addition, report module is also included in Library Management System. If user’s position is
admin, the user is able to generate different kinds of reports like lists of students registered, list of
books, issue and return reports.

All these modules are able to help librarian to manage the library with more convenience and in a
more efficient way as compared to library systems which are not computerized.
Library Management System

1.3 Operation environment

1. Hardware Requirements

• Processor: Minimum Intel Pentium 4 or equivalent (Recommended: Core i3 or higher)


• RAM: At least 2GB (Recommended: 4GB or higher for better performance)
• Storage: Minimum 50MB free disk space (More if dealing with large book databases)
• Input Devices: Keyboard, Mouse (optional for GUI-based enhancements)
• Output Devices: Monitor, Printer (optional for report generation)

2. Software Requirements

• Operating System: Windows (XP/7/8/10/11), Linux (Ubuntu, Fedora, etc.), or macOS


• Compiler: GCC (MinGW for Windows, GCC for Linux/macOS), Turbo C (for older
environments)
• Editor/IDE: Code: Blocks, Dev-C++, Turbo C++, or VS Code
Library Management System

SYSTEM ANALYSIS

In this chapter, we will discuss and analyze about the developing process of Library Management System
including software requirement specification (SRS) and comparison between existing and proposed system. The
functional and nonfunctional requirements are included in SRS part to provide complete description and
overview of system requirement before the developing process is carried out. Besides that, existing vs proposed
provides a view of how the proposed system will be more efficient than the existing one.

2.1 SOFTWARE REQUIREMENT SPECIFICATION


GENERAL DESCRIPTION
PRODUCT DESCRIPTION:
Library Management System is a computerized system which helps user(librarian) to manage the
library daily activity in electronic format. It reduces the risk of paper work such as file lost, file
damaged and time consuming.
It can help user to manage the transaction or record more effectively and time- saving.

PROBLEM STATEMENT:
The problem occurred before having computerized system includes:
• File lost
When computerized system is not implemented file is always lost because of human
environment. Sometimes due to some human error there may be a loss of records.
• File damaged When a computerized system is not their file is always lost due to some
accident like spilling of water by some member on file accidentally. Besides some
natural disaster like floods or fires may also damage the files.
• Difficult to search record

When there is no computerized system there is always a difficulty in searching of


records if the records are large in number.
• Space consuming
Library Management System

After the number of records become large the space for physical storage of file and
records also increases if no computerized system is implemented.
• Cost consuming
As there is no computerized system the to add each record paper will be needed which
will increase the cost for the management of library.

2.1.1 SYSTEM OBJECTIVES


• Improvement in control and performance
The system is developed to cope up with the current issues and problems of library.
The system can add user, validate user and is also bug free.
• Save cost

After computerized system is implemented less human force will be required to


maintain the library thus reducing the overall cost.
• Save time
Librarian is able to search record by using few clicks of mouse and few search
keywords thus saving his valuable time.

2.1.2 SYSTEM REQUIREMENTS


a.i.2.1 NON-FUNCTIONAL REQUIREMENTS
• Product Requirements
EFFICIENCY REQUIREMENT
When a library management system will be implemented librarian and user will easily
access library as searching and book transaction will be very faster.

USABILITY REQUIREMENT
The system is designed for a user-friendly environment so that student and staff of
library can perform the various tasks easily and in an effective way.
Library Management System

System Architecture
The Library Management System (LMS) is built using a layered architecture to organize different
functionalities efficiently. It consists of three key layers:

1. User Interface Layer


a. Provides a console-based menu for interaction.
b. Users (librarians or students) can navigate through options like adding books, issuing
books, modifying records, etc.
2. Application Logic Layer
a. Implements core functionalities such as book management, issue/return processes, and
modifications.
b. Uses file handling to store and retrieve data.
3. Data Storage Layer
a. Uses text (.txt) and binary (.dat) files instead of databases.
b. Each file stores book details, student records, and issued books for persistent data
management.
c. Ensures data retrieval and modification using fopen(), fread(), fwrite(), and
fclose().
Library Management System

Technologies Used

This system is implemented using C programming language and uses various standard
libraries:

Technology Purpose
C Language Core programming language for logic implementation
File Handling (.txt/.dat) Persistent storage of book and student records
Input and output operations (printf, scanf, fopen,
<stdio.h>
fclose)
Memory management and program control (exit(),
<stdlib.h>
malloc())
<string.h> String handling functions (strcpy(), strcmp(), fgets())
<time.h> Capturing and formatting dates for book issuance
Library Management System

Features of the System


The Library Management System includes the following key functionalities:

📚 Book Management

• Add Book: Users can enter book details like ID, title, author, and the date of addition.
• Modify Book: Allows users to update book details.
• Delete Book: Users can remove a book record.
• View Books: Displays a list of all available books.

🎓 Student Management

• Stores student details (Name, Roll Number, Branch, Semester).


• Ensures each student is assigned books properly.

📖 Book Issuing and Return

• Issue Book: Allows students to borrow books by entering student details.


• Issued Book List: Shows all books currently issued along with student details.
• (Optional) Return Book Feature: Can be added to mark a book as returned.

💾 Data Storage and Retrieval

• Persistent storage using file handling (books.txt, issue.txt).


• Fast searching for books using unique IDs.

🖥️ Simple User Interface

• Console-based menu-driven UI for easy navigation.


• Error handling for invalid inputs.
Library Management System

Page Structure and Layout

Since this is a console-based system, it follows a structured menu-driven approach:

📌 Main Menu

Upon running the program, users see:

Users enter a number (1-7) to navigate through different functionalities.

1.Add Book Submenu


When the user selects "1. Add Book," they are prompted to enter book details:
Library Management System

• User enters book details (ID, Name, Author).


• The book is stored in books.txt.
• User can add multiple books in a single session.

2.Books List Submenu


When the user selects "2. Books List," all available books are displayed:

• Displays book details in a tabular format.


• Fetches data from (books.txt).
Library Management System

3.Modify Book Submenu


When the user selects "3. Modify Book," they are prompted to enter the book ID for modification:

• User enters Book ID to modify.


• Displays current book details for reference.
• User enters updated details, which replace the old data in (books.txt).
Library Management System

4.Issue Book Submenu


When the user selects "4. Issue Book," they are prompted to enter student and book details:

• Checks if the book exists in books.txt.


• Stores issue details in issue.txt.
• Each student can issue only one book at a time.
Library Management System

5.Issued Books List Submenu


When the user selects "5. Issue List," all issued books are displayed:

• Displays all books currently issued with student details.


• Fetches data from issue.txt.
Library Management System

6.Delete Book Submenu


When the user selects "6. Delete Book," they are prompted to enter the book ID to remove:

• Checks if the book exists before deleting.


• Deletes the book by creating a temporary file and removing the original books.txt.

7.Exit Submenu
When the user selects "7. Exit," the system terminates:
Library Management System

Source code
#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <time.h>

struct Book {

int id;

char bookName[50];

char authorName[75];

char date[12];

};

struct Student {

int id;

char sName[50];

char sbranch[50];

int ssem;

int sRoll;

char bookName[50];

char date[12];

};
Library Management System

void addBook(void);

void booksList(void);

void modify_Book(void);

void issueBook(void);

void issueList(void);

void deleteBook(void);

int main() {

int choice = 1;

while (choice != 7) {

printf("\n1. Add Book");

printf("\n2. Books List");

printf("\n3. Modify Book");

printf("\n4. Issue Book");

printf("\n5. Issue List");

printf("\n6. Delete Book");

printf("\n7. Exit");

printf("\nEnter Option: ");

scanf("%d", &choice);

switch (choice) {

case 1:
Library Management System

addBook();

break;

case 2:

booksList();

break;

case 3:

modify_Book();

break;

case 4:

issueBook();

break;

case 5:

issueList();

break;

case 6:

deleteBook();

break;

case 7:

exit(0);

default:

printf("\nInvalid option, please try again.");

}
Library Management System

return 0;

void addBook() {

struct Book b;

char myDate[12];

time_t t = time(NULL);

struct tm tm = *localtime(&t);

sprintf(myDate, "%02d/%02d/%d", tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);

strcpy(b.date, myDate);

char ans = 'y';

FILE *fp;

fp = fopen("books.txt", "a+");

if (fp == NULL) {

printf("Unable to open file\n");

return;

while (ans == 'y') {

printf("Enter book id: ");

scanf("%d", &b.id);
Library Management System

printf("Enter book name: ");

scanf("%s", b.bookName);

printf("Enter author name: ");

scanf("%s", b.authorName);

fwrite(&b, sizeof(b), 1, fp);

printf("Book Added Successfully\n");

printf("\nDo you want to continue (y/n)? ");

getchar();

ans = getchar();

fclose(fp);

void booksList() {

struct Book b;

FILE *fp;

printf(" ------Available Books------ \n\n");

printf("%-10s %-30s %-20s %s\n\n", "Book id", "Book Name", "Author", "Date");
Library Management System

fp = fopen("books.txt", "rb");

if (fp == NULL) {

printf("Unable to open file\n");

return;

while (fread(&b, sizeof(b), 1, fp) == 1) {

printf("%-10d %-30s %-20s %s\n", b.id, b.bookName, b.authorName, b.date);

fclose(fp);

void modify_Book() {

int id, found = 0;

struct Book b;

char ans = 'y';

FILE *fp, *ft;

while (ans == 'y') {

ft = fopen("temp.txt", "w");

fp = fopen("books.txt", "r");

if (fp == NULL || ft == NULL) {


Library Management System

printf("Unable to open temp file\n");

return;

printf("Enter Book id to modify: ");

scanf("%d", &id);

fread(&b, sizeof(struct Book), 1, fp);

while (!feof(fp)) {

if (b.id == id) {

printf("Enter new book id: ");

scanf("%d", &b.id);

printf("Enter new book name: ");

scanf("%s", b.bookName);

printf("Enter new author name: ");

scanf("%s", b.authorName);

fwrite(&b, sizeof(b), 1, ft);

fread(&b, sizeof(b), 1, fp);

}
Library Management System

fclose(fp);

fclose(ft);

if (found) {

remove("books.txt");

rename("temp.txt", "books.txt");

printf("Book modified successfully.\n");

} else {

printf("No book found with ID %d.\n", id);

printf("\nDo you want to continue (y/n)? ");

getchar();

ans = getchar();

void issueBook() {

struct Student s;

struct Book b;

FILE *fp;

char myDate[12];
Library Management System

time_t t = time(NULL);

struct tm tm = *localtime(&t);

sprintf(myDate, "%02d/%02d/%d", tm.tm_mday, tm.tm_mon + 1, tm.tm_year + 1900);

strcpy(s.date, myDate);

int found = 0;

printf(" ------Issue Books------ \n\n");

printf("Enter Book id to issue: ");

scanf("%d", &s.id);

fp = fopen("books.txt", "rb");

if (fp == NULL) {

printf("Unable to open books file\n");

return;

while (fread(&b, sizeof(b), 1, fp) == 1) {

if (b.id == s.id) {

strcpy(s.bookName, b.bookName);

found = 1;

break;
Library Management System

fclose(fp);

if (!found) {

printf("No book found with this id\n");

printf("Please try again...\n\n");

return;

fp = fopen("issue.txt", "a+");

if (fp == NULL) {

printf("Unable to open issue file\n");

return;

printf("Enter Student Name: ");

scanf("%s", s.sName);

printf("Enter Student branch: ");

scanf("%s", &s.sbranch);

printf("Enter Student semester: ");

scanf("%d", &s.ssem);

printf("Enter Student Roll: ");


Library Management System

scanf("%d", &s.sRoll);

fwrite(&s, sizeof(s), 1, fp);

fclose(fp);

printf("Book Issued Successfully\n");

void issueList() {

struct Student s;

FILE *fp;

printf(" ------Book Issue List------ \n\n");

printf("%-10s%-20s%-15s%-10s%-10s%-20s%-10s\n\n", "S.id", "Name", "Branch", "Sem", "Roll",


"Book Name", "Date");

fp = fopen("issue.txt", "r");

if (fp == NULL) {

printf("Unable to open issue file\n");

return;

fread(&s, sizeof(s), 1, fp);

while (!feof(fp)) {

printf("%-10d%-20s%-15s%-10d%-10d%-20s%-10s\n", s.id, s.sName, s.sbranch, s.ssem, s.sRoll,


s.bookName, s.date);

fread(&s, sizeof(s), 1, fp);


Library Management System

fclose(fp);

void deleteBook() {

int id, found = 0;

struct Book b;

FILE *fp, *ft;

printf("------ Delete Book ------\n");

printf("Enter Book id to delete: ");

scanf("%d", &id);

fp = fopen("books.txt", "rb");

if (fp == NULL) {

printf("Unable to open books file\n");

return;

ft = fopen("temp.txt", "wb");

if (ft == NULL) {

printf("Unable to open temp file\n");

fclose(fp);
Library Management System

return;

while (fread(&b, sizeof(b), 1, fp) == 1) {

if (b.id != id)

fwrite(&b, sizeof(b), 1, ft);

else {

found = 1;

fclose(fp);

fclose(ft);

if (found) {

remove("books.txt");

rename("temp.txt", "books.txt");

printf("Book with ID %d deleted successfully.\n", id);

else {

printf("No book found with ID %d.\n", id);

remove("temp.txt");

}
Library Management System
Library Management System

Future Enhancement

• Add a mobile application for easier access.


• Integrate advanced technologies like:
• AI-powered recommendations for users based on their borrowing history.
• Support for multiple branches in a centralized system.
Library Management System

References

• W3 schools
• Greeks for greeks
• Code with harry

You might also like