🙢
LIBRARY MANAGEMENT
SYSTEM
🙢
▪ This system, it is basically concerned about
managing the order of books in library
▪ It has 2 section:
LIBRARIAN: It allows the administrator to
handle all
activities.
USER: It allows the user to choose book
▪ It improves the method of managing the
arrangements of books
INTRODUCTION
🙢
ADVANTAGES:
1. It keeps the record.
2. Improves method of handling books
4. Reduction of errors.
APPLICATION:
1.Highly Secure, Scalable & Reliable
2.Can be used in any library
🙢
USE CASE DIAGRAM:
LOGIN
ADD
BOOK
SARCH
BOOK
VIEW
BOOK
DELETE
BOOK
UPDATE
PASSWO
RD
CASH
PAY
USER LIBRARIAN
🙢
FLOW CHART
🙢
FUNCTIONS IMPLEMENTED:
� Add Information
� Search Information
� View Information
� Delete Information
� Update password
� Add student details
� EXIT
🙢
� To Add, Delete, Update menu----Linked List.
� For backup---binary files.
----Text files.
� Go to ,if else conditions for decision making.
� For ,while loop--looping
IMPLEMENTED PROGRAMME
🙢
#PROGRAM
#include<stdio.h> #include<stdlib.h> #include<time.h>
#include<string.h> #include<ctype.h> #include<conio.h>
#define MAX_YR 9999
#define MIN_YR 1900
#define MAX_SIZE_USER_NAME 30
#define MAX_SIZE_PASSWORD 20 #define FILE_NAME
"studentlibrary.bin"
// Macro related to the books info #define
MAX_BOOK_NAME 50
#define MAX_AUTHOR_NAME 50
#define MAX_STUDENT_NAME 50
#define MAX_STUDENT_ADDRESS 300
#define FILE_HEADER_SIZE sizeof(sFileHeader)
//structure to store date typedef struct
{
int yyyy; int mm; int dd;
🙢
🙢
for(pos =0 ; pos < len ; pos++)
{
//print space printf(" ");
}
//print message printf("%s",message);
}
void headMessage(const char *message)
{
system("cls");
printf("ttt#####################
##############################
########################");
printf("nttt############
############");
printf("nttt############
Library management System
Project in C
############");
printf("nttt############
🙢
{
headMessage("Student Library");
printf("nnnnn");
printf("nttt **-**-**-**-**-**-**-**-**-**-
**-**-**-**-**-**-**-**-**n");
printf("nttt =-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=-=-=");
printf("nttt =
WELCOME
="); printf("nttt
= TO
="); printf("nttt =
LIBRARY
="); printf("nttt =
MANAGEMENT
=");
printf("nttt =
SYSTEM =");
printf("nttt =-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=-=-=");
printf("nttt **-**-**-**-**-**-**-**-**-**-
**-**-**-**-**-**-**-**-**n");
printf("nnnttt Enter any key to
continue n");
🙢
{
validName = 0; break;
}
}
return validName;
}
// Function to check leap year.
//Function returns 1 if leap year int
IsLeapYear(int year)
{
return (((year % 4 == 0) && (year % 100 !=
0)) ||
(year % 400 == 0));
}
// returns 1 if given date is valid. int
isValidDate(Date *validDate)
{
//check range of year,month and day if
(validDate->yyyy > MAX_YR ||
🙢
if (validDate->dd < 1 || validDate->dd >
31) return 0;
//Handle feb days in leap year if
(validDate->mm == 2)
{
if (IsLeapYear(validDate->yyyy)) return
(validDate->dd <= 29);
else
return (validDate->dd <= 28);
}
//handle months which has only 30 days
if (validDate->mm == 4 || validDate->mm
== 6 || validDate->mm == 9 ||
validDate->mm == 11)
return (validDate->dd <= 30); return 1;
}
// Add books in list
void addBookInDataBase()
{
int days;
🙢
🙢
if(fp == NULL)
{
printf("File is not openedn"); exit(1);
}
headMessage("ADD NEW BOOKS");
printf("nntttENTER YOUR
DETAILS BELOW:");
printf("nttt -n");
printf("ntttBook ID NO = ");
fflush(stdin);
scanf("%u",&addBookInfoInDataBase.book
s_id); do
{
printf("ntttBook Name = ");
fflush(stdin);
fgets(addBookInfoInDataBase.bookName,
MAX_BOOK_NAME,stdin); status =
isNameValid(addBookInfoInDataBase.boo
kName);
if (!status)
{
🙢
🙢
s_BooksInfo addBookInfoInDataBase = {0};
FILE *fp = NULL;
int status = 0;
fp = fopen(FILE_NAME,"rb"); if(fp ==
NULL)
{
printf("ntttFile is not openedn");
exit(1);
}
headMessage("SEARCH BOOKS");
//put the control on books detail
if
(fseek(fp,FILE_HEADER_SIZE,SEEK_SET)
!= 0)
{
fclose(fp);
printf("ntttFacing issue while reading
filen"); exit(1);
}
printf("nntttEnter Book Name to
🙢
found = 1; break;
}
}
if(found)
{
printf("ntttBook id =
%un",addBookInfoInDataBase.books_id);
printf("tttBook name =
%s",addBookInfoInDataBase.bookName);
printf("tttBook authorName
=
%s",addBookInfoInDataBase.authorName);
printf("tttBook issue
date(day/month/year) =
(%d/%d/%d)",addBookInfoInDataBase.bo
okIssueDate.dd,
addBookInfoInDataBase.bookIssueDate.m
m,
addBookInfoInDataBase.bookIssueDate.yy
yy);
}
else
🙢
{
int found = 0;
char bookName[MAX_BOOK_NAME] =
{0}; s_BooksInfo addBookInfoInDataBase =
{0}; FILE *fp = NULL;
int status = 0;
unsigned int countBook = 1;
headMessage("VIEW BOOKS DETAILS");
fp = fopen(FILE_NAME,"rb");
if(fp == NULL)
{
printf("File is not openedn"); exit(1);
}
if
(fseek(fp,FILE_HEADER_SIZE,SEEK_SET)
!= 0)
{
fclose(fp);
printf("Facing issue while reading filen");
exit(1);
}
🙢
printf("ntttBook name =
%s",addBookInfoInDataBase.bookName);
printf("tttBook authorName
=
%s",addBookInfoInDataBase.authorName);
printf("tttBook issue
date(day/month/year) =
(%d/%d/%d)nn",addBookInfoInDataBa
se.bookIssueDate.dd,
addBookInfoInDataBase.bookIssueDate.m
m,
addBookInfoInDataBase.bookIssueDate.yy
yy);
found = 1;
++countBook;
}
fclose(fp); if(!found)
{
printf("ntttNo Record");
}
printf("nntttPress any key to go to
🙢
char bookName[MAX_BOOK_NAME] =
{0}; s_BooksInfo addBookInfoInDataBase =
{0}; FILE *fp = NULL;
FILE *tmpFp = NULL; int status = 0;
headMessage("Delete Books Details"); fp =
fopen(FILE_NAME,"rb");
if(fp == NULL)
{
printf("File is not openedn"); exit(1);
}
tmpFp = fopen("tmp.bin","wb"); if(tmpFp
== NULL)
{
fclose(fp);
printf("File is not openedn"); exit(1);
}
fread
(&fileHeaderInfo,FILE_HEADER_SIZE, 1,
fp);
fwrite(&fileHeaderInfo,FILE_HEADER_SI
🙢
{
if(addBookInfoInDataBase.books_id !=
bookDelete)
{
fwrite(&addBookInfoInDataBase,sizeof(ad
dBookInfoInDataBase), 1, tmpFp);
}
else
{
found = 1;
}
}
(found)? printf("ntttRecord
deleted
successfully....."):printf("ntttRecord
not found");
fclose(fp); fclose(tmpFp);
remove(FILE_NAME);
rename("tmp.bin",FILE_NAME);
}
🙢
fp = fopen(FILE_NAME,"rb+"); if(fp ==
NULL)
{
printf("File is not openedn"); exit(1);
}
fread
(&fileHeaderInfo,FILE_HEADER_SIZE, 1,
fp); if (fseek(fp,0,SEEK_SET) != 0)
{
fclose(fp);
printf("ntttFacing issue while
updating passwordn"); exit(1);
}
printf("nntttNew Username:");
fflush(stdin);
fgets(userName,MAX_SIZE_USER_NAME
,stdin); printf("nntttNew
Password:");
fflush(stdin);
fgets(password,MAX_SIZE_PASSWORD,s
🙢
printf("ntttLogin Again:");
fflush(stdin);
getchar(); exit(1);
}
void menu()
{
int choice = 0; do
{
headMessage("MAIN MENU");
printf("nnnttt1.Add Books");
printf("nttt2.Search Books");
printf("nttt3.View Books");
printf("nttt4.Delete Book");
printf("nttt5.Update Password");
printf("nttt0.Exit");
printf("nnntttEnter choice => ");
scanf("%d",&choice);
🙢
start=book_issue(start); break;
}
case 2:{
start=book_return(start); break;
}
case 3:{
display(start); break;
}
case 4:{
exit(1);
}
default:{
printf("ntttt...Invalid Option!...n");
getch();
}
}
} while(choice!=4);
}
🙢
start=book_issue(start); break;
}
case 2:{
start=book_return(start); break;
}
case 3:{
display(start); break;
}
case 4:{
exit(1);
}
default:{
printf("ntttt...Invalid Option!...n");
getch();
}
}
} while(choice!=4);
}
🙢
new_book4=(struct
book*)malloc(sizeof(struct book));
new_book4->next=NULL;
strcpy(new_book4->name,"The 8051
Microcontroller"); strcpy(new_book4-
>author,"Moh.Ali Mazidi"); new_book4-
>id=104;
ptr->next=new_book4; ptr=new_book4;
new_book5=(struct
book*)malloc(sizeof(struct book));
new_book5->next=NULL;
strcpy(new_book5-
>name,"Microprocessor");
strcpy(new_book5->author,"A.P.Godse");
new_book5->id=105;
ptr->next=new_book5;
return start_lib;
}
🙢
printf("ntttt No books left in the
library to issue!ntttt Sorry for the
inconvenience!n");
}else{
system("cls"); ptr=start_lib;
printf("nt*************** Books Available:
****************n"); while(ptr!=NULL){
printf("nt_ _ n");
printf("nt Book %d",i);
printf("nt Book Title: %s",ptr->name);
printf("nt Name of Author: %s",ptr-
>author); printf("nt Book ID: %d",ptr-
>id);
printf("nt_ _ n"); ptr=ptr-
>next;
i++;
}
printf("nnt Enter the Book ID: ");
scanf("%d",&id);
ptr=start_lib; while(ptr!=NULL){
if(ptr->id==id){ flag=1; break;
🙢
}
ptr=ptr->next;
}
if(flag==1){ ptr=start_lib; while(ptr-
>id!=id){
ptr=ptr->next;>id);
}
new_student=(struct student
*)malloc(sizeof(struct student));
printf("nt Enter Student Details:n ");
printf("nt Enter your Name: ");
scanf("%s",new_student->name);
printf("nt Enter your Email: ");
scanf("%s",new_student->email);
strcpy(new_student->book,ptr->name);
strcpy(new_student->a,ptr->author);
new_student->id=ptr->id;
new_student->next=NULL;
printf("nt Issue of Book ID %d done
successfully!n",new_student-
printf("nnt********************************
🙢
while(ptr2->next!=NULL){ ptr2=ptr2-
>next;
}
ptr2->next=new_student;
}
start_lib=delete_book(new_student->id);
printf("nnt Press any key to go to the
main menu: "); getch();
}else{
printf("ntt ...Invalid Option!...n");
printf("ntt Press any key to try
again: "); getch();
}
}
return start;
}
🙢
printf("nnt Enter your Book ID: ");
scanf("%d",&identity);
ptr=start; while(ptr!=NULL){
if(ptr->id==identity){ flag=1;
break;
}
ptr=ptr->next;
}
if(flag==1){ ptr=start; while(ptr!=NULL){
c++;
ptr=ptr->next;
}
ptr=start;
while(ptr->id!=identity){ d++;
ptr=ptr->next;
}
ptr=start; if( d==1 ){
printf("nt_ _ n");
🙢
printf("nt Student Name: %s",start-
>name); printf("nt Student Email:
%s",start->email); printf("nt Name of
Book Issued: %s",start->book);
printf("nt_ _ n");
printf("nnt Return of Book ID %d done
successfully!n",identity);
printf("nnt********************************
*****************n");
strcpy(bookname,start->book);
strcpy(authorname,start->a); id=start->id;
start=start->next; free(ptr);
add_book(bookname,authorname,id);
}else{
ptr=start;
while(ptr->id!=identity){ preptr=ptr;
ptr=ptr->next;
}
printf("nt_ _ n");
printf("nt Student Name: %s",ptr-
>name);
🙢
printf("nt_ _ n");
strcpy(bookname,ptr->book);
strcpy(authorname,ptr->a); id=ptr->id;
preptr->next=ptr->next; free(ptr);
add_book(bookname,authorname,id);
}
printf("nt Thank you! nt Do visit
again! "); printf("nnt Press any key to
go to the main menu: "); getch();
system("cls");
}else{
printf("ntSorry the book doesn't exist!
Please recheck the entered ID"); getch();
system("cls");
}
return start;
}
void display(struct student *start){ struct
student *ptr;
🙢
printf("nt************* Details of
Students: **************n");
printf("nt_ _ n");
printf("ntt Student Name: %s",ptr-
>name);
printf("ntt Student Email: %s",ptr-
>email); printf("ntt Name of Book
Issued: %s",ptr->book); printf("ntt
Book ID: %d",ptr->id);
printf("nt_ _ n");
printf("nnt********************************
*****************n");
ptr=ptr->next;
}
printf("nnt Press any key to go to the
main menu: "); getch();
system("cls");
}
🙢
if(c==1){ ptr=start_lib; start_lib=NULL;
free(ptr);
}else if(start_lib->id==id){ ptr=start_lib;
start_lib=start_lib->next; free(ptr);
}else{
ptr=start_lib; while(ptr->id!=id){
preptr=ptr; ptr=ptr->next;
}
preptr->next=ptr->next; free(ptr);
}
return start_lib;
}
struct book *add_book(char
bookname[30],char authorname[30],int id){
struct book *ptr,*new_book;
new_book=(struct book
*)malloc(sizeof(struct book));
strcpy(new_book->name,bookname);
strcpy(new_book->author,authorname);
🙢
new_book->id=id; new_book-
>next=NULL; if(start_lib==NULL){
start_lib=new_book;
}else{ ptr=start_lib;
while(ptr->next!=NULL){ ptr=ptr->next;
}
ptr->next=new_book;
}
return start_lib;
}
🙢
OUTPUT:
Student Library Portal
🙢
Login:
🙢
Select Choice:
2. Add New Book:
🙢
Search Book Details
🙢
View Book Details
🙢
Delete Book Details
🙢
Update Password:
🙢
Again Login
🙢
Again, Login with New Password
:
🙢
Sucessfull Login with New Password:
🙢
� This project provides a computerized version of library
management system which will benefit the students as
well as the staff of the library.
� It makes entire process online where student can search
books, do book transactions.
� It helps managing the system very efficiently and
conveniently.
� There is a future scope of this facility that many more
features such as student login where student can login,
can see status of request for book.
CONCLUSION
🙢
THANK YOU

LIBRARY MANAGEMENT SYSTEM ppt.pptx

  • 1.
  • 2.
    🙢 ▪ This system,it is basically concerned about managing the order of books in library ▪ It has 2 section: LIBRARIAN: It allows the administrator to handle all activities. USER: It allows the user to choose book ▪ It improves the method of managing the arrangements of books INTRODUCTION
  • 3.
    🙢 ADVANTAGES: 1. It keepsthe record. 2. Improves method of handling books 4. Reduction of errors. APPLICATION: 1.Highly Secure, Scalable & Reliable 2.Can be used in any library
  • 4.
  • 5.
  • 6.
    🙢 FUNCTIONS IMPLEMENTED: � AddInformation � Search Information � View Information � Delete Information � Update password � Add student details � EXIT
  • 7.
    🙢 � To Add,Delete, Update menu----Linked List. � For backup---binary files. ----Text files. � Go to ,if else conditions for decision making. � For ,while loop--looping IMPLEMENTED PROGRAMME
  • 8.
    🙢 #PROGRAM #include<stdio.h> #include<stdlib.h> #include<time.h> #include<string.h>#include<ctype.h> #include<conio.h> #define MAX_YR 9999 #define MIN_YR 1900 #define MAX_SIZE_USER_NAME 30 #define MAX_SIZE_PASSWORD 20 #define FILE_NAME "studentlibrary.bin" // Macro related to the books info #define MAX_BOOK_NAME 50 #define MAX_AUTHOR_NAME 50 #define MAX_STUDENT_NAME 50 #define MAX_STUDENT_ADDRESS 300 #define FILE_HEADER_SIZE sizeof(sFileHeader) //structure to store date typedef struct { int yyyy; int mm; int dd;
  • 9.
  • 10.
    🙢 for(pos =0 ;pos < len ; pos++) { //print space printf(" "); } //print message printf("%s",message); } void headMessage(const char *message) { system("cls"); printf("ttt##################### ############################## ########################"); printf("nttt############ ############"); printf("nttt############ Library management System Project in C ############"); printf("nttt############
  • 11.
    🙢 { headMessage("Student Library"); printf("nnnnn"); printf("nttt **-**-**-**-**-**-**-**-**-**- **-**-**-**-**-**-**-**-**n"); printf("nttt=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-=-=-=-=-=-="); printf("nttt = WELCOME ="); printf("nttt = TO ="); printf("nttt = LIBRARY ="); printf("nttt = MANAGEMENT ="); printf("nttt = SYSTEM ="); printf("nttt =-=-=-=-=-=-=-=-=-=-=- =-=-=-=-=-=-=-=-=-=-=-="); printf("nttt **-**-**-**-**-**-**-**-**-**- **-**-**-**-**-**-**-**-**n"); printf("nnnttt Enter any key to continue n");
  • 12.
    🙢 { validName = 0;break; } } return validName; } // Function to check leap year. //Function returns 1 if leap year int IsLeapYear(int year) { return (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)); } // returns 1 if given date is valid. int isValidDate(Date *validDate) { //check range of year,month and day if (validDate->yyyy > MAX_YR ||
  • 13.
    🙢 if (validDate->dd <1 || validDate->dd > 31) return 0; //Handle feb days in leap year if (validDate->mm == 2) { if (IsLeapYear(validDate->yyyy)) return (validDate->dd <= 29); else return (validDate->dd <= 28); } //handle months which has only 30 days if (validDate->mm == 4 || validDate->mm == 6 || validDate->mm == 9 || validDate->mm == 11) return (validDate->dd <= 30); return 1; } // Add books in list void addBookInDataBase() { int days;
  • 14.
  • 15.
    🙢 if(fp == NULL) { printf("Fileis not openedn"); exit(1); } headMessage("ADD NEW BOOKS"); printf("nntttENTER YOUR DETAILS BELOW:"); printf("nttt -n"); printf("ntttBook ID NO = "); fflush(stdin); scanf("%u",&addBookInfoInDataBase.book s_id); do { printf("ntttBook Name = "); fflush(stdin); fgets(addBookInfoInDataBase.bookName, MAX_BOOK_NAME,stdin); status = isNameValid(addBookInfoInDataBase.boo kName); if (!status) {
  • 16.
  • 17.
    🙢 s_BooksInfo addBookInfoInDataBase ={0}; FILE *fp = NULL; int status = 0; fp = fopen(FILE_NAME,"rb"); if(fp == NULL) { printf("ntttFile is not openedn"); exit(1); } headMessage("SEARCH BOOKS"); //put the control on books detail if (fseek(fp,FILE_HEADER_SIZE,SEEK_SET) != 0) { fclose(fp); printf("ntttFacing issue while reading filen"); exit(1); } printf("nntttEnter Book Name to
  • 18.
    🙢 found = 1;break; } } if(found) { printf("ntttBook id = %un",addBookInfoInDataBase.books_id); printf("tttBook name = %s",addBookInfoInDataBase.bookName); printf("tttBook authorName = %s",addBookInfoInDataBase.authorName); printf("tttBook issue date(day/month/year) = (%d/%d/%d)",addBookInfoInDataBase.bo okIssueDate.dd, addBookInfoInDataBase.bookIssueDate.m m, addBookInfoInDataBase.bookIssueDate.yy yy); } else
  • 19.
    🙢 { int found =0; char bookName[MAX_BOOK_NAME] = {0}; s_BooksInfo addBookInfoInDataBase = {0}; FILE *fp = NULL; int status = 0; unsigned int countBook = 1; headMessage("VIEW BOOKS DETAILS"); fp = fopen(FILE_NAME,"rb"); if(fp == NULL) { printf("File is not openedn"); exit(1); } if (fseek(fp,FILE_HEADER_SIZE,SEEK_SET) != 0) { fclose(fp); printf("Facing issue while reading filen"); exit(1); }
  • 20.
    🙢 printf("ntttBook name = %s",addBookInfoInDataBase.bookName); printf("tttBookauthorName = %s",addBookInfoInDataBase.authorName); printf("tttBook issue date(day/month/year) = (%d/%d/%d)nn",addBookInfoInDataBa se.bookIssueDate.dd, addBookInfoInDataBase.bookIssueDate.m m, addBookInfoInDataBase.bookIssueDate.yy yy); found = 1; ++countBook; } fclose(fp); if(!found) { printf("ntttNo Record"); } printf("nntttPress any key to go to
  • 21.
    🙢 char bookName[MAX_BOOK_NAME] = {0};s_BooksInfo addBookInfoInDataBase = {0}; FILE *fp = NULL; FILE *tmpFp = NULL; int status = 0; headMessage("Delete Books Details"); fp = fopen(FILE_NAME,"rb"); if(fp == NULL) { printf("File is not openedn"); exit(1); } tmpFp = fopen("tmp.bin","wb"); if(tmpFp == NULL) { fclose(fp); printf("File is not openedn"); exit(1); } fread (&fileHeaderInfo,FILE_HEADER_SIZE, 1, fp); fwrite(&fileHeaderInfo,FILE_HEADER_SI
  • 22.
    🙢 { if(addBookInfoInDataBase.books_id != bookDelete) { fwrite(&addBookInfoInDataBase,sizeof(ad dBookInfoInDataBase), 1,tmpFp); } else { found = 1; } } (found)? printf("ntttRecord deleted successfully....."):printf("ntttRecord not found"); fclose(fp); fclose(tmpFp); remove(FILE_NAME); rename("tmp.bin",FILE_NAME); }
  • 23.
    🙢 fp = fopen(FILE_NAME,"rb+");if(fp == NULL) { printf("File is not openedn"); exit(1); } fread (&fileHeaderInfo,FILE_HEADER_SIZE, 1, fp); if (fseek(fp,0,SEEK_SET) != 0) { fclose(fp); printf("ntttFacing issue while updating passwordn"); exit(1); } printf("nntttNew Username:"); fflush(stdin); fgets(userName,MAX_SIZE_USER_NAME ,stdin); printf("nntttNew Password:"); fflush(stdin); fgets(password,MAX_SIZE_PASSWORD,s
  • 24.
    🙢 printf("ntttLogin Again:"); fflush(stdin); getchar(); exit(1); } voidmenu() { int choice = 0; do { headMessage("MAIN MENU"); printf("nnnttt1.Add Books"); printf("nttt2.Search Books"); printf("nttt3.View Books"); printf("nttt4.Delete Book"); printf("nttt5.Update Password"); printf("nttt0.Exit"); printf("nnntttEnter choice => "); scanf("%d",&choice);
  • 25.
    🙢 start=book_issue(start); break; } case 2:{ start=book_return(start);break; } case 3:{ display(start); break; } case 4:{ exit(1); } default:{ printf("ntttt...Invalid Option!...n"); getch(); } } } while(choice!=4); }
  • 26.
    🙢 start=book_issue(start); break; } case 2:{ start=book_return(start);break; } case 3:{ display(start); break; } case 4:{ exit(1); } default:{ printf("ntttt...Invalid Option!...n"); getch(); } } } while(choice!=4); }
  • 27.
    🙢 new_book4=(struct book*)malloc(sizeof(struct book)); new_book4->next=NULL; strcpy(new_book4->name,"The 8051 Microcontroller");strcpy(new_book4- >author,"Moh.Ali Mazidi"); new_book4- >id=104; ptr->next=new_book4; ptr=new_book4; new_book5=(struct book*)malloc(sizeof(struct book)); new_book5->next=NULL; strcpy(new_book5- >name,"Microprocessor"); strcpy(new_book5->author,"A.P.Godse"); new_book5->id=105; ptr->next=new_book5; return start_lib; }
  • 28.
    🙢 printf("ntttt No booksleft in the library to issue!ntttt Sorry for the inconvenience!n"); }else{ system("cls"); ptr=start_lib; printf("nt*************** Books Available: ****************n"); while(ptr!=NULL){ printf("nt_ _ n"); printf("nt Book %d",i); printf("nt Book Title: %s",ptr->name); printf("nt Name of Author: %s",ptr- >author); printf("nt Book ID: %d",ptr- >id); printf("nt_ _ n"); ptr=ptr- >next; i++; } printf("nnt Enter the Book ID: "); scanf("%d",&id); ptr=start_lib; while(ptr!=NULL){ if(ptr->id==id){ flag=1; break;
  • 29.
    🙢 } ptr=ptr->next; } if(flag==1){ ptr=start_lib; while(ptr- >id!=id){ ptr=ptr->next;>id); } new_student=(structstudent *)malloc(sizeof(struct student)); printf("nt Enter Student Details:n "); printf("nt Enter your Name: "); scanf("%s",new_student->name); printf("nt Enter your Email: "); scanf("%s",new_student->email); strcpy(new_student->book,ptr->name); strcpy(new_student->a,ptr->author); new_student->id=ptr->id; new_student->next=NULL; printf("nt Issue of Book ID %d done successfully!n",new_student- printf("nnt********************************
  • 30.
    🙢 while(ptr2->next!=NULL){ ptr2=ptr2- >next; } ptr2->next=new_student; } start_lib=delete_book(new_student->id); printf("nnt Pressany key to go to the main menu: "); getch(); }else{ printf("ntt ...Invalid Option!...n"); printf("ntt Press any key to try again: "); getch(); } } return start; }
  • 31.
    🙢 printf("nnt Enter yourBook ID: "); scanf("%d",&identity); ptr=start; while(ptr!=NULL){ if(ptr->id==identity){ flag=1; break; } ptr=ptr->next; } if(flag==1){ ptr=start; while(ptr!=NULL){ c++; ptr=ptr->next; } ptr=start; while(ptr->id!=identity){ d++; ptr=ptr->next; } ptr=start; if( d==1 ){ printf("nt_ _ n");
  • 32.
    🙢 printf("nt Student Name:%s",start- >name); printf("nt Student Email: %s",start->email); printf("nt Name of Book Issued: %s",start->book); printf("nt_ _ n"); printf("nnt Return of Book ID %d done successfully!n",identity); printf("nnt******************************** *****************n"); strcpy(bookname,start->book); strcpy(authorname,start->a); id=start->id; start=start->next; free(ptr); add_book(bookname,authorname,id); }else{ ptr=start; while(ptr->id!=identity){ preptr=ptr; ptr=ptr->next; } printf("nt_ _ n"); printf("nt Student Name: %s",ptr- >name);
  • 33.
    🙢 printf("nt_ _ n"); strcpy(bookname,ptr->book); strcpy(authorname,ptr->a);id=ptr->id; preptr->next=ptr->next; free(ptr); add_book(bookname,authorname,id); } printf("nt Thank you! nt Do visit again! "); printf("nnt Press any key to go to the main menu: "); getch(); system("cls"); }else{ printf("ntSorry the book doesn't exist! Please recheck the entered ID"); getch(); system("cls"); } return start; } void display(struct student *start){ struct student *ptr;
  • 34.
    🙢 printf("nt************* Details of Students:**************n"); printf("nt_ _ n"); printf("ntt Student Name: %s",ptr- >name); printf("ntt Student Email: %s",ptr- >email); printf("ntt Name of Book Issued: %s",ptr->book); printf("ntt Book ID: %d",ptr->id); printf("nt_ _ n"); printf("nnt******************************** *****************n"); ptr=ptr->next; } printf("nnt Press any key to go to the main menu: "); getch(); system("cls"); }
  • 35.
    🙢 if(c==1){ ptr=start_lib; start_lib=NULL; free(ptr); }elseif(start_lib->id==id){ ptr=start_lib; start_lib=start_lib->next; free(ptr); }else{ ptr=start_lib; while(ptr->id!=id){ preptr=ptr; ptr=ptr->next; } preptr->next=ptr->next; free(ptr); } return start_lib; } struct book *add_book(char bookname[30],char authorname[30],int id){ struct book *ptr,*new_book; new_book=(struct book *)malloc(sizeof(struct book)); strcpy(new_book->name,bookname); strcpy(new_book->author,authorname);
  • 36.
    🙢 new_book->id=id; new_book- >next=NULL; if(start_lib==NULL){ start_lib=new_book; }else{ptr=start_lib; while(ptr->next!=NULL){ ptr=ptr->next; } ptr->next=new_book; } return start_lib; }
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
    🙢 Again, Login withNew Password :
  • 46.
  • 47.
    🙢 � This projectprovides a computerized version of library management system which will benefit the students as well as the staff of the library. � It makes entire process online where student can search books, do book transactions. � It helps managing the system very efficiently and conveniently. � There is a future scope of this facility that many more features such as student login where student can login, can see status of request for book. CONCLUSION
  • 48.