0% found this document useful (0 votes)
46 views48 pages

Main Report

The document discusses the objectives and design of a library management system. The system allows librarians to manage library activities and records electronically. It reduces errors and saves time compared to manual systems. The waterfall model is used in the design. The objectives are to handle all library processes efficiently and keep track of book and user information digitally.

Uploaded by

Aditya Mahakal
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)
46 views48 pages

Main Report

The document discusses the objectives and design of a library management system. The system allows librarians to manage library activities and records electronically. It reduces errors and saves time compared to manual systems. The waterfall model is used in the design. The objectives are to handle all library processes efficiently and keep track of book and user information digitally.

Uploaded by

Aditya Mahakal
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
You are on page 1/ 48

Chapter 1

Introduction
TITLE:-

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. Librarian is able to search record by
using few clicks of mouse and few search keywords thus saving his valuable time.

In their libraries, this automated system is designed in order to facilitate all those libraries
with the old systems. Hopefully with all of the changes, it would make the libraries run much
more smoothly.
With less time spent filling out paperwork, more time can be devoted to serving the
customers and maintaining the potentially vast amount of books held in the library. The next
sections of the paper include; Literature review, Methodology and Conclusion. With this
Library Management System, librarians will be able to monitor and manage library’s
inventory more efficiently and will be able to perform all of the main library operations.

INTRODUCTION:-

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.

Library management system is a small program to manage library which includes the task
of:-
 Adding new users, books and magazines/newspapers.
 Updating users, books and magazines/newspapers.
 Deleting users, books and magazines/newspapers.
 Issuing books.
 Collecting books back.
 Crystal report generation.
 Searching for books, users.
 In our project we will be able to classify users as staff or student.
Classifying users allows the book issue controls, fine rates based on the classification.
1
For example for students we will be able to issue two books at the find rate of Rs 2 as late fee
and three book at the time rate of Rs 1 for staffs. What more, we can change this setting
based on our needs but we have to set the values just one and every time the program starts.
We have used my setting class to implement this.

The software to be produced is on Library Management System. Here there are 2 users. They
are The Admin and the receptionist. The first procedure is the registration of the people who
arrive to the library.

The receptionist has the authority to enter the name, address and contact number of the
people who visit the library along with the name of the book they want to read. Their entry
and exit time to the library will be noted down.
This calculates the total amount of time they spent in library. A library card will also be
provided to the customers who visit daily.

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.

Library management system is a project which aims in developing a computerized system to


maintain all the daily work of library.
This project has many features which are generally not available in normal library
management systems like facility of user login and a facility of teacher’s login .It also has a
facility of admin login through which the admin can monitor the whole system.

It also has facility of an online notice board where teachers can student can put up
information about workshops or seminars being held in our colleges or nearby colleges and
librarian after proper verification from the concerned institution organizing the seminar can
add it to the notice board.

It has also a facility where student after logging in their accounts can see list of books issued
and its issue date and return date and also the students can request the librarian to add new
books by filling the book request form.
The librarian after logging into his account i.e. admin account can generate various reports
such as student report, issue report, teacher report and book report. A person can also borrow
the book for particular days. All the information will be entered in the system. If the person
doesn’t return the book before the due date, a fine will be added and the information will be
sent to that particular person about the fine.

Admin has the authority to add, delete or modify the details of the book available to/from the
system. He also has the authority to provide username and password for the receptionist
Overall this project of ours is being developed to help the students as well as staff of library
to maintain the library in the best way possible and also reduce the human efforts.
Chapter -2
2
Analysis of Project

Purpose:-

The purpose of library management pro system is to provide a medium for the public libraries
to computerize their entire functioning and would contribute as a first step in digitalizing their
libraries, a still now in India, public libraries (medium and small scale) had their entire
records on paper which again required main tenancy and the problem of finding relevant
information proved to be a herculean task.

Even if the required information was found it was usually at cost of much valuable time.

Library management pro would not only simplify this process but also speed up the entire
function in goes the library.
It will also contribute towards increasing the efficiency of the library as a whole, right from
the data entry to maintaining the historical records.

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.

One major purpose is to provide user or the library members the opportunity to not only
search through the books but to reserve books that are issued by other users and also request
newer books.

The purpose of library management pro system is to provide a medium for the public libraries
to computerize their entire functioning and would contribute as a first step in digitalizing their
libraries, a still now in India, public libraries (medium and small scale) had their entire
records on paper which again required main penance and the problem of finding relevant
information proved to be a herculean task.

Even if the required information was found it was usually at cost of much valuable time.
Library management pro would not only simplify this process but also speed up the entire
function in goes the library.

It will also contribute towards increasing the efficiency of the library as a whole, right from
the data entry to maintaining the historical records.

One major purpose is to provide user or the library members the opportunity to not only
search through the books but to reserve books that are issued by other users and also request
newer books.

3
Waterfall Model:-

 Requirements- Defines needed information, functions, behaviour, performance and


interfaces (specification and planning).
 Design-Data structures, software architecture, interface representations, algorithmic
details.
 Implementation-Source code, data base user documentation, testing, installation and
maintenance

Fig no. 2.1 Water Fall Model

OBJECTIVES:-

4
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.

The objective of the “Library Management Software” is to handle the entire activity of a
library. The software keeps track of all the information about the books in the library, their
cost, their complete details and total number of books available in the Library. The user will
find it easy in this automated system rather than using the manual writing system. The system
contains a database where all the information will be stored safely. The system is user-
friendly and error free.

Many libraries around the world have started a digital process of book-record keeping.
Library management system project in C is the replication of the similar process that guides
you through the management of books inside a library.

The main aim of this C project on Library management system is to implement simple
programming approach in C language to show hoe a library is managed in real-time. No
graphic programming has been done in this project and it runs on simple DOS console.

The library management system includes similar processes as in the real-library like adding
Books, keeping records of issued and returned book, view the records, find books and delete
records of books from the library. Such system requires the same data in day to day activities
because of which we make use of file handling to keep track of the record. This C mini
project can also be implemented in a real-library.

Here, we present you the source code and execution file of the project which is not long
enough. The source code is error free and well organized while the comments placed will also
clear out your confusion. We’ve made the download available for the source code and
execution file of the project.

It can help user to manage the transaction or record more effectively and time-saving.

1. 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.

2. Save cost

After computerized system is implemented less human force will be required to maintain the
library thus reducing the overall cost.

3. Save time

Librarian is able to search record by using few clicks of mouse and few search keywords thus
saving his valuable time.

Chapter – 3
Project Details
5
Modules of the software:

 Books: Admin has the authority to add, delete or modify the details of the book
available to/from the system.

 Library Registration: The first procedure is the registration of the people who arrive
to the library. The receptionist has the authority to enter the name, address and contact
number of the people who visit the library along with the name of the book they want
to read.

 Time spent: Their entry and exit time to the library will be noted down. This
calculates the total amount of time they spent in library.

 Purchase books: Admin can also add the details of the book purchased from shops
along with the shop name. He also has the authority to delete from or modify it to the
database.

 Borrow books: A person can also borrow the book for particular days. All the
information will be entered in the system. If the person doesn’t return the book before
the due date, a fine
 will be added and the information will be sent to that particular person about the fine.

 Login registration: Admin also has the authority to provide username and password
for the receptionist.

 Reports: Monthly expense report, books purchased report, cash collected for fee can
also be viewed

Basically there are two main modules, they are

 Admin Module

 Users Admin Module

The Admin module stores the details of staff working in the library, the details of students,
the details of books, updates the status of books ,adds newly purchased book details to the
database ,issues the books, collects fine etc.

User Module is further classified into two because in an institution for example an
engineering college the user may be a staff or a student.
6
The users have the functionalities like accessing the books, search for a book etc.
The Library Management System provides exact information about the number of books that
are taken by the users, the number of books that are left, date of issue etc and it even
calculates the fine automatically, thereby reducing the risk present in the manual management
of libraries.

Flow Chart-

3.1 Flow Chart

Modules:-

 Login
 Add Books
 Search Book
 Delete Book
 View Book Details
 Edit Book Record
 Change Password
 Student Details
 Close Application

Library database:-

7
Fig 3.2 Library Database

DataBase Management Library (DBL):-

8
Database Management Library (DBL) is a relational database management system (RDBMS)
contained in a C programming library. The DBL source code is available under the terms of
the GNU General Public License.

DBL was fully developed within two weeks, as a holiday programming project.It aims to be
easy and simple to use for C programming.

Design

DBL is a library and becomes an integral part of the application program. Unlike client–
server model database management systems that are standalone process with which the
application program communicates. The application software uses DBL's functionality
through function calls.

Sample programs

Creating a simple database

This is a basic program that creates a simple database. However, as this task must be done
usually once, it can be done by the DBL command-line interface.

1. Include<iostream.h>
int main()
database (“mydatabase”)

This class stores the database name and its tables. The main functions are:-

char *name(); //get the database name

char *name(char *dbname); //set the database


name

void new_tab(char *tabname); //create a new


table

table *get_tab(char *tabname); //return the


pointer to the table

File Handling :-

9
A file represents a sequence of bytes on the disk where a group of related data is stored. File
is created for permanent storage of data. It is a readymade structure.

In C language, we use a structure pointer of file type to declare a file.

FILE *temp;

C provides a number of functions that helps to perform basic file operations. Following are
the functions,

Opening a File or Creating a File:-

10
The fopen () function is used to create a new file or to open an existing file.

General Syntax:

*temp = FILE *fopen(const char record.dat, const char *rb+);


Here filename is the name of the file to be opened and mode specifies the purpose of
opening the file. Mode can be of following types,

*temp is the FILE pointer (FILE *temp), which will hold the reference to the opened(or
created) file.

Closing a File
11
The fclose() function is used to close an already opened file.

General Syntax:

int fclose( FILE *temp );

Here fclose() function closes the file and returns zero on success, or EOF if there is an error
in closing the file. This EOF is a constant defined in the header file stdio.h.

Input/Output operation on File


In the above table we have discussed about various file I/O functions to perform reading and
writing on file. getc() and putc() are simplest functions used to read and write individual
characters to a file.

{
FILE *temp;
temp = fopen("Record.dat","rb+");
while(fread(&book,sizeof(book),1,temp)==1)
if(book.id == t){
fclose(temp);
return 0;
fclose(temp);
return 1;
}
void searchByID(){
system("cls");
int id; FILE *temp;
gotoxy(25,4);
printf("****Search Books By Id****");
gotoxy(20,5);
printf("Enter the book id:");
scanf("%d",&id);
int findBook = 0;
fp = fopen("Record.dat","rb");
while(fread(&book,sizeof(book),1,fp)==1){
if(book.id==id){
Sleep(2);
gotoxy(20,7);
printf("The Book is available");
gotoxy(20,8);

In this program, we have create two FILE pointers and both are refering to the same file but
in different modes. fprintf() function directly writes into the file, while fscanf() reads from
the file, which can then be printed on console usinf standard printf() function.

Difference between Append and Write Mode:-


12
Write (w) mode and Append (a) mode, while opening a file are almost the same. Both are
used to write in a file. In both the modes, new file is created if it doesn't exist already.

The only difference they have is, when you open a file in the write mode, the file is reset,
resulting in deletion of any data already present in the file. While in append mode this will
not happen. Append mode is used to append or add data to the existing data of file(if any).
Hence, when you open a file in Append(a) mode, the cursor is positioned at the end of the
present data in the file.

Reading and Writing in a Binary File:-


A Binary file is similar to the text file, but it contains only large numerical data. The Opening
modes are mentioned in the table for opening modes above.

fread() and fwrite() functions are used to read and write is a binary file.

fwrite(data-element-to-be-written, size_of_elements,

number_of_elements, pointer-to-file);

fread() is also used in the same way, with the same arguments like fwrite() function. Below
mentioned is a simple example of writing into a binary file.

void searchByName(){
system("cls");
char s[15];
int d=0;
FILE *fp;
gotoxy(25,4);
printf("****Search Books By Name****");
gotoxy(20,5);
printf("Enter Book Name:");
scanf("%s",s);
fp = fopen("Record.dat","rb");
while(fread(&book,sizeof(book),1,fp)==1){
if(strcmp(book.name,(s))==0){ //checks whether
book.name is equal to s or not
gotoxy(20,7);
printf("The Book is available");
gotoxy(20,8);

fseek(), ftell() and rewind() functions:-


13
fseek() - It is used to move the reading control to different positions using fseek function.

ftell() - It tells the byte location of current position of cursor in file pointer.

rewind() – it moves the control to beginning of the file.

Creating a file and output some data :-

In order to create files we have to learn about File I/O i.e. how to write data into a file and
how to read data from a file. We will start this section with an example of writing data to a
file. We begin as before with the include statement for stdio.h, then define some variables for
use in the example including a rather strange looking new type.

The type FILE is used for a file variable and is defined in the stdio.h file. It is used to define a
file pointer for use in file operations. Before we can write to a file, we must open it. What this
really means is that we must tell the system that we want to write to a file and what the file
name is. We do this with the fopen() function illustrated in the first line of the program. The
file pointer, fp in our case, points to the file and two arguments are required in the
parentheses, the file name first, followed by the file type.

The file name is any valid DOS file name, and can be expressed in upper or lower case
letters, or even mixed if you so desire. It is enclosed in double quotes. For this example we
have chosen the name TENLINES.TXT. This file should not exist on your disk at this time. If
you have a file with this name, you should change its name or move it because when we
execute this program, its contents will be erased.
If you don’t have a file by this name, that is good because we will create one and put some
data into it.

You are permitted to include a directory with the file name. The directory must, of course, be
a valid directory otherwise an error will occur. Also, because of the way C handles literal
strings, the directory separation character \ must be written twice. For example, if the file is to
be stored in the \PROJECTS sub directory then the file name should be entered as “\\
PROJECTS\\TENLINES.TXT”.
The second parameter is the file attribute and can be any of three letters, r, w, or a, and must
be lower case.

Reading (r)

14
When an r is used, the file is opened for reading, a w is used to indicate a file to be used for
writing, and an indicates that you desire to append additional data to the data already in an
existing file. Most C compilers have other file attributes available; check your Reference
Manual for details. Using the r indicates that the file is assumed to be a text file. Opening a
file for reading requires that the file already exist. If it does not exist, the file pointer will be
set to NULL and can be checked by the program.

Here is a small program that reads a file and display its contents on screen:-

void adminsignin(){
char temp[10];
login = fopen("password.dat","r");
gotoxy(10,10);
printf("Enter password: ");
get_password(temp);
while(fread(&password,
sizeof(password),1,login)==1){
while(strcmp(temp,password)!=0){
system("cls");
gotoxy(10,10);
printf("Password did not match!
");
printf("Enter Again: ");
get_password(temp);
}

Writing (w)

15
When a file is opened for writing, it will be created if it does not already exist and it will be
reset if it does, resulting in the deletion of any data already there. Using the w indicates that
the file is assumed to be a text file.

Here is the program to create a file and write some data into the file:-

void adminsignup()
{
char temp[10];
login = fopen("password.dat","w");
gotoxy(10,10);
printf("Enter password: ");
get_password(password);
gotoxy(10,11);
printf("Re Enter Password: ");
get_password(temp);
while(strcmp(password,temp)!=0)
{

Chapter-4
16
Features and Screenshot:-

1. WELCOME PAGE

Fig 4.1 Welcome Page

2. USER LOGIN

This feature used by the user to login into system. They are required to enter user id and
password before they are allowed to enter the system .The user id and password will be
verified and if invalid id is there user is allowed to not enter the system.

Functional requirements
a. User id is provided for registering.
b. The system must only allow user with valid id and password to enter the system
c. The system performs authorization process which decides what user level can access.
d. The user must be able to logout after they finished using system.

Fig 4.2 User Login


3. REGISTER NEW BOOK
17
This feature allows adding new books to the library.

Book Details

S.N. Field Name Type Name


1. Book No Number i.e. 6432
2. Book Name Text i.e. Basic Computer
3. Author Name Text i.e. Preet Gill
4. Edition Text i.e. 7th edition

Table no. 4.1

Fig 4.3.1 Selection of Categories

Functional requirements

a. System must be able to verify information


b. System must be able to enter number of copies into table.
c. System must be able to not allow two books having same book id.

18
Fig 4.3.2 Register New Books

4. SEARCH BOOK

This feature is found in book maintenance part. We can search book based on book id , book
name , publication or by author name. The software must be able to search and give details
for a specified book on user’s request.

Fig 4.4 Search Book

 Purpose:-The purpose of this is to enable the users to search for a required book even
if the user is not able to provide information about the book.
 Stimulus/Response:-Once the user chooses this option , he is asked to enter the title
and name of the author of the book to be searched.

19
 Associated Functional Requirements:-Functional Requirements- Searching by
Author’s name, It must also be able to handle invalid inputs and search for the exact
book.
 Introduction:-The user must be asked to enter the title and author of the required
book upon which the specified book can be searched.
 Inputs:-The user can search for a book by giving the title and author name of the
book.
 Processing:-The software must provide details of all books given a particular title of
the book and author name and display
 Outputs:-All the books with the given title and author name are displayed. And also
the information about where it can be found is displayed.

Functional requirements
a. System must be able to search the database based on select search type.
b. System must be able to filter book based on keyword entered.
c. System must be able to show the filtered book in table view.

5. Delete Book-

Fig 4.5 Delete Books

There is also a option of deleting the pre added books from the directory which are not in the
library or may be lost or may be replaced. This function the delete the books and its whole
information about the book.

20
6. ISSUE BOOKS AND RETURN BOOKS-

This feature allows issuing and returning books and also viewing reports of book issued.

Functional requirements

a. System must be able to enter issue information in database.


b. System must be able to update number of books.
c. System must be able to search if book is available or not before issuing books.
d. System should be able to enter issue and return date information.

Product Functions:-

The major function includes:


 Providing details about the books available in library according to their
department and author wise for searching purpose.
 Giving details about fine and their time of returning the books.
 Provide facility of online registration of books.
 Providing facility of online registration of books.
 Updating of books by the librarian according to the understandable order.
 Providing the book transaction such as borrowing, renewal, retrieval of books
in an easier manner.

Problem Overcomes:-

The problem occurred before having computerized system includes:

1. 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.

2. File damaged

When a computerized system is not there 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.

21
7. CHANGE PASSWORD

It is used to change the password of Login page. Password change process is easy in it.
First to change the password enter old password and after then enter the new password
what you want to do.

A password manager is a software application that helps a user store an organize


passwords. Password managers usually store passwords encrypted, requiring the user to
create a master password; a single, ideally very strong password which grants the user
access to their entire passwords database.

Click the change password button, than follow the onscreen instruction. If you are using a
password hint, remember to update the hint for your new password.

Fig 4.7 Change Password

22
E-R Diagram

Fig E-R Diagram

E-R diagram for library management system-

 In the library management system, the following entities and attributes can be
identified.

 Book –the set all the books in the library. Each books has a book -id, title, author,
price and available, (Y/N) as its attributes.

 Member – the set all the library members. The member is described by the attributes
member-id, name, street, city, zip-code, mem-type, mem-date (date of membership)
expiry-date.

 Publisher – the set of all the publisher of the books. Attributes of this entity are pub-
id, name, street, city, and zip-code.

 Supplier – the set of all the supplier of the books. Attributes of this entity are sup-id,
name, street, city and Zip-code.

23
Chapter-5
Functions

These are the functions used in this mini project:


void mainmenu (void) – This function is used to display the main menu of this project.
Scroll down to Output to view the main menu.

void returnfunc (void) – Inside this function, the main menu function (mentioned above) is
called when the user presses a key. With this, the user can return back to the main menu.

void addbooks(void) – This function adds books in a file. For that, you need to mention the
department to which you want to add the book. The record is saved in a file. And, it is similar
for the following functions as well.

void deletebooks(void)

void editbooks(void)

void searchbooks(void)

void issuebooks(void)

void viewbooks(void)

void issuerecord() – With this function, you can keep record of the student to whom the
book has been issued.

void closeapplication(void) – This function is for closing the application.

int getdata() – This function asks for data input from the user.

int checkid(int) – This function is used to check whether the ID of a book entered by a user
exists in file or not.

void Password() – Due to this function, the user is asked to input password to run the
application after it is opened. You can’t change the password upon running the application.

void gotoxy (int x, int y) – You need to understand this function as it is one of the most
important one used in mini project on Library Management System in C. This function
allows you to print text in any place of screen. Using this function in Code::Blocks requires
coding, but it can be directly used in Turbo C. Here is a code for this function in Code

delay (unsigned int mseconds)- this function delays the execution. It can be used
directly in Turbo C, but requires coding in code:: blocks. . Here is a code for this function in
Code.

24
Chapter-6
IMPLEMENTATION OF PROGRAM

(Header Files)
//list of header files

#include "general_functions.h"
#include "core_functions.h"

int main(){
login = fopen("password.dat","rb");
if(login == NULL){
gotoxy(10,9);
printf("Database Do not exits. Be an adminstrator. Sign
Up");
adminsignup();
}else{
adminsignin();
}
mainmenu();
return 0;
}

void mainmenu()
{
while(1){
system("cls");
gotoxy(20,3);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2 MAIN MENU \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2");
gotoxy(20,5);
printf("\xDB\xDB\xDB\xDB\xB2 1. Add Books ");
gotoxy(20,7);
printf("\xDB\xDB\xDB\xDB\xB2 2. Delete Book");

25
gotoxy(20,9);
printf("\xDB\xDB\xDB\xDB\xB2 3. Search Book");
gotoxy(20,11);
printf("\xDB\xDB\xDB\xDB\xB2 4. View Book List");
gotoxy(20,13);
printf("\xDB\xDB\xDB\xDB\xB2 5. Edit Book Record ");
gotoxy(20,15);
printf("\xDB\xDB\xDB\xDB\xB2 6. Change Password");
gotoxy(20,17);
printf("\xDB\xDB\xDB\xDB\xB2 7. Close Application");
gotoxy(20,19);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(20,21);
printf("Enter your choice:");
switch(getch()){
case '1':
addbooks();
break;
case '2':
deletebooks();
break;
case '3':
searchbooks();
break;
case '4':
viewbooks();
break;
case '5':
editbooks();
break;
case '6':
change_password();
gotoxy(10,13);
printf("press any key to continue....");
getch();
break;
case '7':

26
creditNclose();
default:
gotoxy(10,23);
printf("\aWrong Entry!!Please re-entered correct
option");
getch(); //holds the screen until a key is pressed
}
}
}
void addbooks(void){ //funtion that add books
system("cls");
FILE *fp;
int i, choice;
add_window();
gotoxy(20,22);
printf("Enter your choice:");
scanf("%d", &choice);
if(choice==7)
mainmenu() ;
system("cls");
fp = fopen("Record.dat","ab+");
if(getdata(choice) == 1){
book.cat=catagories[choice-1];
fseek(fp,0,SEEK_END);
fwrite(&book,sizeof(book),1,fp);
fclose(fp);
gotoxy(21,14);
printf("The record is sucessfully saved");
gotoxy(21,15);
printf("Save any more?(Y / N):");
if(getch()=='n')
mainmenu();
else{
system("cls");
addbooks();
}
}
fclose(fp);
}

27
void deletebooks(){ //function that delete items from file
Record.dat
FILE *ft,*fp;
system("cls");
int d,findBook = 0;
char another='y';
while(another=='y'){ //infinite loop
system("cls");
gotoxy(10,5);
printf("Enter the Book ID to delete:");
scanf("%d",&d);
fp = fopen("Record.dat","rb+");
while(fread(&book,sizeof(book),1,fp)==1){
if(book.id==d){
gotoxy(10,7);
printf("The book record is available");
gotoxy(10,8);
printf("Book name is %s",book.name);
gotoxy(10,9);
printf("Rack No. is %d",book.rackno);
findBook = 1;
gotoxy(10,10);
printf("Do you want to delete it?(Y/N):");
if(getch()=='y'){
ft=fopen("test.dat","wb"); //temporary file for
delete
rewind(fp);
while(fread(&book,sizeof(book),1,fp)==1){
if(book.id!=d){
fwrite(&book,sizeof(book),1,ft); //write
all in tempory file except that
} //we want to
delete
}
fclose(fp);
fclose(ft);
remove("Record.dat");
rename("test.dat","Record.dat"); //copy all item
from temporary file to fp except that

28
//we want to delete
gotoxy(10,11);
printf("The record is sucessfully deleted");
}
}
}
if(findBook == 0){
gotoxy(10,10);
printf("No record is found");
getch();
}
gotoxy(10,12);
printf("Delete another record?(Y/N)");
fflush(stdin);
another=getch();
}
}

void searchbooks()
{
system("cls");
printf("*****************************Search
Books*********************************");
gotoxy(20,10);
printf("\xDB\xDB\xDB\xB2 1. Search By ID");
gotoxy(20,14);
printf("\xDB\xDB\xDB\xB2 2. Search By Name");
gotoxy( 15,20);
printf("Enter Your Choice");
switch(getch())
{
case '1':
searchByID();
break;
break;
case '2':
searchByName();
break;

29
default :
getch();
searchbooks();
}
}

void viewbooks(void) //show the list of book persists in library


{
int j;
FILE *fp;
system("cls");
gotoxy(1,1);
printf("*********************************Book
List*****************************");
gotoxy(2,2);
printf(" CATEGORY ID BOOK NAME AUTHOR QTY
PRICE RackNo ");
j=4;
fp=fopen("Record.dat","rb");
while(fread(&book,sizeof(book),1,fp)==1){
gotoxy(3,j);
printf("%s",book.cat);
gotoxy(16,j);
printf("%d",book.id);
gotoxy(22,j);
printf("%s",book.name);
gotoxy(36,j);
printf("%s",book.Author);
gotoxy(50,j);
printf("%d",book.quantity);
gotoxy(57,j);
printf("%.2f",book.Price);
gotoxy(69,j);
printf("%d",book.rackno);
printf("\n\n");
j++;
}
fclose(fp);
gotoxy(35,25);

30
returnfunc();
}

void editbooks(void) //edit information about book


{
system("cls");
FILE *fp;
int c=0,d;
gotoxy(20,4);
printf("****Edit Books Section****");
char another='y';
while(another=='y')
{
system("cls");
gotoxy(15,6);
printf("Enter Book Id to be edited:");
scanf("%d",&d);
fp=fopen("Record.dat","rb+");
while(fread(&book,sizeof(book),1,fp)==1)
{
if(checkid(d)==0)
{
gotoxy(15,7);
printf("The book is availble");
gotoxy(15,8);
printf("The Book ID:%d",book.id);
gotoxy(15,9);
printf("Enter new
name:");scanf("%s",book.name);
gotoxy(15,10);
printf("Enter new
Author:");scanf("%s",book.Author);
gotoxy(15,11);
printf("Enter new
quantity:");scanf("%d",&book.quantity);
gotoxy(15,12);
printf("Enter new
price:");scanf("%f",&book.Price);

31
gotoxy(15,13);
printf("Enter new
rackno:");scanf("%d",&book.rackno);
gotoxy(15,14);
printf("The record is modified");
fseek(fp,ftell(fp)-sizeof(book),0);
fwrite(&book,sizeof(book),1,fp);
fclose(fp);
c=1;
}
if(c==0)
{
gotoxy(15,9);
printf("No record found");
}
}
gotoxy(15,16);
printf("Modify another Record?(Y/N)");
fflush(stdin);
another=getch() ;
}
returnfunc();
}

(Core Functions)

int getdata(int choice)


{
int bookID;
gotoxy(20,3);printf("Enter the Information Below");
gotoxy(20,4);printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2");
gotoxy(20,5);
printf("\xB2");gotoxy(46,5);printf("\xB2");
gotoxy(20,6);
printf("\xB2");gotoxy(46,6);printf("\xB2");
gotoxy(20,7);
printf("\xB2");gotoxy(46,7);printf("\xB2");
32
gotoxy(20,8);
printf("\xB2");gotoxy(46,8);printf("\xB2");
gotoxy(20,9);
printf("\xB2");gotoxy(46,9);printf("\xB2");
gotoxy(20,10);
printf("\xB2");gotoxy(46,10);printf("\xB2");
gotoxy(20,11);
printf("\xB2");gotoxy(46,11);printf("\xB2");
gotoxy(20,12);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(21,5);
printf("Category:");
gotoxy(31,5);
printf("%s",catagories[choice-1]);
gotoxy(21,6);
printf("Book ID:");
gotoxy(30,6);
scanf("%d",&bookID);
if(checkid(bookID) == 0)
{
gotoxy(21,13);
printf("The book id already exists");
getch();
addbooks();
return 0;
}
book.id=bookID;
gotoxy(21,7);
printf("Book Name:");gotoxy(33,7);
scanf("%s",book.name);
gotoxy(21,8);
printf("Author:");gotoxy(30,8);
scanf("%s",book.Author);
gotoxy(21,9);
printf("Quantity:");gotoxy(31,9);
scanf("%d",&book.quantity);
gotoxy(21,10);
printf("Price:");gotoxy(28,10);

33
scanf("%f",&book.Price);
gotoxy(21,11);
printf("Rack No:");gotoxy(30,11);
scanf("%d",&book.rackno);
return 1;
}

int checkid(int t) //check whether the book is exist in library or


not
{
FILE *temp;
temp = fopen("Record.dat","rb+");
while(fread(&book,sizeof(book),1,temp)==1)
if(book.id == t){
fclose(temp);
return 0;
}
fclose(temp);
return 1;

void searchByID(){
system("cls");
int id; FILE *fp;
gotoxy(25,4);
printf("****Search Books By Id****");
gotoxy(20,5);
printf("Enter the book id:");
scanf("%d",&id);
int findBook = 0;
fp = fopen("Record.dat","rb");
while(fread(&book,sizeof(book),1,fp)==1){
if(book.id==id){
Sleep(2);
gotoxy(20,7);
printf("The Book is available");
gotoxy(20,8);

34
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2");
gotoxy(20,9);
printf("\xB2 ID:%d",book.id);gotoxy(47,9);printf("\
xB2");
gotoxy(20,10);
printf("\xB2 Name:%s",book.name);gotoxy(47,10);printf("\
xB2");
gotoxy(20,11);
printf("\xB2 Author:%s
",book.Author);gotoxy(47,11);printf("\xB2");
gotoxy(20,12);
printf("\xB2 Qantity:%d
",book.quantity);gotoxy(47,12);printf("\xB2");
gotoxy(47,11);printf("\xB2");
gotoxy(20,13);
printf("\xB2 Price:Rs.
%.2f",book.Price);gotoxy(47,13);printf("\xB2");
gotoxy(20,14);
printf("\xB2 Rack No:%d
",book.rackno);gotoxy(47,14);printf("\xB2");
gotoxy(20,15);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2");
findBook = 1;
}
}
if(findBook == 0){ //checks whether conditiion enters inside
loop or not
gotoxy(20,8);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(20,9);printf("\xB2"); gotoxy(38,9);printf("\xB2");
gotoxy(20,10);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(22,9);printf("\aNo Record Found");

35
}
fclose(fp);
gotoxy(20,17);
printf("Try another search?(Y/N)");
if(getch()=='y')
searchByID();
else
mainmenu();
}

void searchByName(){
system("cls");
char s[15];
int d=0;
FILE *fp;
gotoxy(25,4);
printf("****Search Books By Name****");
gotoxy(20,5);
printf("Enter Book Name:");
scanf("%s",s);
fp = fopen("Record.dat","rb");
while(fread(&book,sizeof(book),1,fp)==1){
if(strcmp(book.name,(s))==0){ //checks whether book.name is
equal to s or not
gotoxy(20,7);
printf("The Book is available");
gotoxy(20,8);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2");
gotoxy(20,9);
printf("\xB2 ID:%d",book.id);gotoxy(47,9);printf("\
xB2");
gotoxy(20,10);
printf("\xB2 Name:%s",book.name);gotoxy(47,10);printf("\
xB2");
gotoxy(20,11);
printf("\xB2 Author:
%s",book.Author);gotoxy(47,11);printf("\xB2");

36
gotoxy(20,12);
printf("\xB2 Qantity:
%d",book.quantity);gotoxy(47,12);printf("\xB2");
gotoxy(20,13);
printf("\xB2 Price:Rs.
%.2f",book.Price);gotoxy(47,13);printf("\xB2");
gotoxy(20,14);
printf("\xB2 Rack No:%d
",book.rackno);gotoxy(47,14);printf("\xB2");
gotoxy(20,15);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2");
d++;
}
}
if(d==0){
gotoxy(20,8);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(20,9);printf("\xB2"); gotoxy(38,9);printf("\xB2");
gotoxy(20,10);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(22,9);printf("\aNo Record Found");
}
fclose(fp);
gotoxy(20,17);
printf("Try another search?(Y/N)");
if(getch()=='y')
searchByName();
else
mainmenu();
}

(General Functions)

#include "variables.h"

void gotoxy (int x, int y)


{

37
coord.X = x; coord.Y = y; // X and Y coordinates
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),
coord);
}

void returnfunc()
{
printf(" \nPress ENTER to return to main menu");
a:
if(getch()==13) //allow only use of enter
mainmenu();
else
goto a;
}

void get_password(char* pass)


{
char temp_passP[25];
int i=0;
while(1)
{
temp_passP[i]=getch();
if(temp_passP[i]==13){break;}
else if(temp_passP[i]==8)
{
if(i!=0) {
printf("\b \b");
i--;
} else {printf("\a");}
}
else
{
printf("*");
*(pass+i) = temp_passP[i];
i++;
}
*(pass+i)='\0';
}
}

38
void creditNclose(){
system("cls");
gotoxy(16,3);
printf("Programmer....");
gotoxy(16,6);
printf("nisha singh");
gotoxy(16,8);
printf("E-mail:[email protected]");
gotoxy(16,10);
printf("Department of Computer Enginnering");
gotoxy(16,11);
printf("jaypee nagar rewa ,m.p.");
gotoxy(10,17);
printf("Exiting in 3 second...........>");
Sleep(3000);
exit(0);
}

int t(void) //for time


{
time_t t;
time(&t);
printf("Date and time:%s\n",ctime(&t));
}

void adminsignup(){
char temp[10];
login = fopen("password.dat","wb");
gotoxy(10,10);
printf("Enter password: ");
get_password(password);
gotoxy(10,11);
printf("Re Enter Password: ");
get_password(temp);
while(strcmp(password,temp)!=0){
gotoxy(10,10);

39
printf("Password did not matched! Enter again");
gotoxy(10,11);
printf("Enter password: ");
get_password(password);
gotoxy(10,12);
printf("Re Enter Password: ");
get_password(temp);
system("cls");
}
fwrite(&password,sizeof(password),1,login);
fclose(login);
}

void adminsignin(){
char temp[10];
login = fopen("password.dat","rb");
gotoxy(10,10);
printf("Enter password: ");
get_password(temp);
while(fread(&password, sizeof(password),1,login)==1){
while(strcmp(temp,password)!=0){
system("cls");
gotoxy(10,10);
printf("Password did not match! ");
printf("Enter Again: ");
get_password(temp);
}
gotoxy(10,11);
printf("Password Match");
break;
}
fclose(login);
gotoxy(10,12);
printf("Press any key...");
getch();
}

void add_window(){
gotoxy(20,5);

40
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2SELECT
CATEGOIES\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");
gotoxy(20,7);
printf("\xDB\xDB\xDB\xDB\xB2 1. Computer");
gotoxy(20,9);
printf("\xDB\xDB\xDB\xDB\xB2 2. Electronics");
gotoxy(20,11);
printf("\xDB\xDB\xDB\xDB\xB2 3. Electrical");
gotoxy(20,13);
printf("\xDB\xDB\xDB\xDB\xB2 4. Civil");
gotoxy(20,15);
printf("\xDB\xDB\xDB\xDB\xB2 5. Mechanical");
gotoxy(20,17);
printf("\xDB\xDB\xDB\xDB\xB2 6. Architecture");
gotoxy(20,19);
printf("\xDB\xDB\xDB\xDB\xB2 7. Back to main menu");
gotoxy(20,21);
printf("\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\
xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2");

int change_password(){
system("cls");
FILE *login;
char old_pass[10], new_pass[10];
gotoxy(10,10);
printf("Enter Old password: ");
get_password(old_pass);
gotoxy(10,11);
printf("Enter New password: ");
get_password(new_pass);
login = fopen("password.dat","rb+");
while(fread(&password,sizeof(password),1,login)==1){
if(strcmp(old_pass,password)==0){
strcpy(password,new_pass);
fseek(login,-sizeof(password),SEEK_CUR);
fwrite(&password,sizeof(password),1,login);

41
fclose(login);
gotoxy(10,12);
printf("Password sucessfully changed! ");
return 1;
}else{
gotoxy(10,12);
printf("Password changing process failed!");
return 0;
}

(Variables)

#include<stdio.h>
#include<conio.h>
#include <stdlib.h>
#include<string.h>
#include<time.h>
#include<windows.h>

FILE *login;
//list of global variable
char findBook;
char password[10];

struct BOOK
{
int id;
char name[20];
char Author[20];
int quantity;
float Price;
int rackno;
char *cat;
};
struct BOOK book;

42
COORD coord = {0, 0};

//list of function prototype


char catagories[]

[15]={"Computer","Electronics","Electrical","Civil","Mechnnical","Ar

chitecture"};

void returnfunc(void);

void mainmenu(void);

void addbooks(void);

void deletebooks(void);

void editbooks(void);

void searchbooks(void);

void issuebooks(void);

void viewbooks(void);

void closeapplication(void);

int getdata(int);

int checkid(int);

void Password();

void get_password(char *);

void issuerecord();

void creditNclose();

void adminsignup();

Chapter-7
System Requirements

Context Level:-

43
Fig 7.1 Context Level

User interfaces:-
The interface used is graphical user interface (GUI) and the interface must be easy to
understand. This interface services as a bridge between the user and the software. It also
makes the user interaction with the system easy. The details about the students and staffs
must be filled during online reservation. The user interface includes:

a) Screen formats/organisation: - The introductory screen will be the first to be


displayed which will allow the users to choose either of the one option like viewing
the details of the books they are holding and searching the books, updating the new
books on online registration.

b) Windows format/organisation: - When the user chooses some other option then the
information pertaining to that choice will be displayed in a new window, which
ensures multiple windows to be visible on the screen and the users can switch
between them.

c) Data format: - The data entered by the users will be alphanumeric.

d) End message: - When there are some expectations raising error like entering invalid
details, the n error messages will be displayed prompting the users to re-enter the
details. When an event has taken place successfully like the searching of books, then a
message “Book Available” will be displayed to the user at the end.

Hardware Interfaces:
The system must basically support certain input and output devices. Their descriptions are as
follows:-

44
Name of the Description of purpose Source of input or
item destination of output

Bar Code To check the validity of the library card Source of input
Reader

Printer To print the list of selected books and Destination of output


reports regarding the books taken

SOFTWARE REQUIREMENT:-
 Operating system- Windows 7 is used as the operating system as it is stable and
supports more features and is more user friendly.

 Development tools and Programming language- C & C++ is used to write the whole
code.

 File handling (Database)

HARDWARE REQUIREMENTS:-

Processor : Pentium-IV
Memory : 128MB
Hard Disk : 20GB
Floppy Drive : 1.44MB
Monitor : 14’’ or above
Mouse : Standard Mouse
Key Board : 104 key

SOFTWARE SPECIFICATION:-
Operating system : Windows 7
Front end & Back end: In this project only used front end(C & C++)
Turbo C++ software is needed for the project coding running.

PERFORMANCE REQUIREMENTS:
 At an instant, a maximum of four nodes or users will be given access simultaneously.
 Since the program handles multiple users, if more than one person attempts to save
data to the file stored in database, the program will lock the data file using a two
phase commit protocol to prevent simultaneous access.

Chapter-8
Scope and Limitations

45
Library Management Pro is in itself a complete system, though it has a few limitations but it
has a lot of future scope and features that could be added to make it more widely acceptable.
One limitation is that our software is limited to small and medium scaled libraries.
Also apart from Books, Magazine and Newspaper no new category can be added in the
system (or in turn be issued) like CDs etc.

One of the major future scopes is making our system online. Connecting libraries to a
common data centre will provide globalization to the libraries, and then the user will be able
to search books all over the city and nearby areas. Reviews, rating, comparing of books and
libraries can also be incorporated.

This would help the user to browse through popular books and make his selection based on
the books rating.
The system accepts the General Library Transactions of book issue, return and renewals for
the members. Different areas where we can use these applications are:
Any educational institutes can make use of it for providing information about author, content
of the available books. The system would provide basic set of features to add/update
members, add/update books, and manage check in specifications for the systems based on the
client's statement of need.

CONCLUSION:-

46
This system has been developed using “C” and text files, the system is able to process and
update the database with more ease. It helped in developing today’s library management
system.

Thus the project library management system can we altered in accordance with the future
requirements of the organizations.

After we have completed the project we are sure the problems in the existing system would
overcome. The “LIBRARY MANAGEMENT SYSTEM” process made computerized to
reduce human errors and to increase the efficiency. The main focus of this project is to lessen
human efforts. The maintenance of the records is made efficient, as all the records are stored
in the ACCESS database, through which data can be retrieved easily. The navigation control
is provided in all the forms to navigate through the large amount of records. If the numbers of
records are very large then user has to just type in the search string and user gets the results
immediately.

The editing is also made simpler. The user has to just type in the required field and press the
update button to update the desired field. The Books and Students are given a particular
unique id number. So that they can be accessed correctly and without errors. Our main aim of
the project is to get the correct information about a particular student and books available in
the library.

The problems, which existed in the earlier system, have been removed to a large extent. And
it is expected that this project will go a long way in satisfying users requirements. The
computerization of the Library Management will not only improves the efficiency but will
also reduce human stress thereby indirectly improving human recourses.

REFERENCES:-

47
 Wikipedia

 Digital Library Management of Chandrakanta Swain (Author).

 Let Us C (Yashavant P. Kanetkar)

 How To Program C (Paul Deitel, Harvey Deitel)

 Object Oriented Programming in C++(Robert Lafore)

 Let Us C++ (Yashvant Kanetkar)

 Exploring C(Yashvant Kanetkar)

 Introduction To Computer (Peter Norton)

 Object Oriented Programming With C++(E Balagurusamy)

 Computer Fundamentals (Prdeep K. Sinha. Priti Sinha)

 The C++ programming language (Bjarne stroustrup)

 Theory of Computer science( K.L.P. Mishra, N. Chandrasekaran)

 www.codewithc.com / programmingc / miniproject

 www.codecchamp.com / project / c

 www.codeincodeblock.com / 2011/03 /

 www.slideshare.net /code with c

48

You might also like