Saturday, November 27, 2010

Library Management System in c/c++

Library Management System in c/c++

INDEX

· Introduction

· Description

· Process Flow

· Source code

· Testing(Screen Shots of working program)

· Further Readings (Future Scope)

· Reference(Bibliography)

INTRODUCTION

I will start this project by describing the word “TECHNOLOGY” this word is rapidly changing day by day. Earlier where people were totally dependent on paper to store their data have now moved to the world of computers. Today we see everything is computerized and which is also getting enhanced day by day.

In earlier days people use to write the records for every transaction as a proof but as if now its all on computer. Hence we derive the library maintenance on computer which can be useful for maintaining, editing, saving the records. As we know it was very difficult to modify the information on the peace of papers, but in case of computers its an easy task and therefore we moved in this direction.

Our project is very useful. User is no longer required to check his register in search of records, as now it can be searched over the software by choosing some options. The user need not to type in most of the information. He/she is just required to enter the desired options. On the whole it liberates the user from keeping lengthy manual records. In a nutshell, it abates the work load of an organization.

In today’s world, no one likes to perform calculations on calculator or manually when computer is there. Every one wants his/her work to be done by computer automatically and displaying the result for further manipulations.


DESCRIPTION:-

This Library Management System is designed to make the library management virtual by making this live on computer systems, such helping the maintenance team, saving the time, and collecting the database. I have tried here to make this in the most famous programming language C++. Where I have used few of its inbuilt libraries to make the system more simplified and fruitful. This management system can help the library managers to save more then 1000 records, and modification and deletion at instant.

PROCESS FLOW:-



THE PROCESS OF SELECTED OPERATIONS HAS DIFFERENT SAVING, MODIFIENG, DELETING PROCESS FLOW

SOURCE CODE:-

//**********************************************************

// LIBRARY MANAGEMENT SYSTEM- RAJAT JAIN

//**********************************************************

//**********************************************************

// INCLUDED HEADER FILES

//**********************************************************

#include

#include

#include

#include

#include

class lib

{

public: static char date[10];

void issuebook(); void returnbook();

void background();

void mainmenu();

void introduc(); int c; int k[3],a;

char ch,d; static int da;

static int fine;

static char name[10];

static long int reg;

int bcode;

void addnewbook(int,char tname[33],int);

// char *bookname(int);

int bookfound(int);

// int booknamefound(char[]);

void addbook();

int available(int);

int s;

int n; char bname[29]; int avail;

private:

};

//Main function where all the parts of program are invoked and called.

int main()

{int a,n;

clrscr();

lib k;

k.background();

return(0);

}

//Add book function this function is used for adding book to library .

void lib::addbook()

{int a,n;

lib l[120];

fstream filin;

filin.open("lib.dat",ios::in|ios::out|ios::app);

if(!filin)

{ cout<<"\nCan't open file";

}

cout<<"\nHow many books u want to enter ";

cin>>n;

for(int i=0;i

{ filin.seekg(0);

cout<<"\nEnter book's name ";

cin>>l[i].bname;

cout<<"Enter book code ";

cin>>l[i].bcode;

l[i].avail=1;

l[i].addnewbook(l[i].bcode,l[i].bname,l[i].avail);

filin.write((char *)&l[i],sizeof(l[i]));

}

cout<<"\nThe entries u did are as follows\n";

ifstream fin;

for(i=0;i

{ filin.read((char *)&l[i],sizeof(l[i]));

cout<<"\n book's name ";

cout<

cout<<"\n book code ";

cout<

} fin.close();

getch(); }

//Background this functions containing front page and others page graphics most of them are designed inside it. It controls graphic part of whole program.

void lib::background()

{

char stylestr[40];

cout<<"\n Lovely Professional University";

cout<<"\n*******************************************************************************";

cout<<"\nC++ PROJECT";

cout<<"\nLIBRARY MANAGEMENT";

cout<<"\nThis Software is for Library management";

cout<<"\nIn this Project student has to enter its name,reg no etc.";

cout<<"\nSubmitted by:";

cout<<"\nRajat Jain";

getch();

cout<<"\nTO GET ENTER IN LIBRARY PRESS ENTER";

cout<<"\nWELCOME TO";

cout<<"\nLPU";

cout<<"\nLIB";

getch();

mainmenu();

}

//Static data members definition globally they are to be defined globally so that they can be used any where.

char lib::name[10];

long int lib::reg;

char lib::date[10];

//Issuebook function this function is used for issuing book ie it is controlling the part from where student can issue book it is containing details required for issuing book.

void lib::issuebook()

{ lib l[120];int n;

clrscr();

cout<<"\nHave u added book(y/n): ";

cin>>ch;

if(ch=='y'|ch=='Y')

{

cout<<"\nEnter ur name ";

cin>>name;

cout<<"\nenter date eg 12 dec";

cin>>date;

cout<<"\nEnter ur reg. no ";

cin>>reg;

cout<<"\n\n how many books are there";

cin>>n;

for(int m=0;m

{cout<<"\n\nEnter the book code u want to issue ";

cin>>l[m].bcode;

c=bookfound(l[m].bcode);

cout<<"\n O available otherwise 1 "<

if(c==0)

{ cout<<"\n\n Book not found";

}

else

if(c==1)

{cout<<"\n\n Book found";

cout<<"\n\n U want to issue this book(y/n): ";

cin>>d;

if(d=='y'|d=='Y')

{ cout<<"\n Book issued to";

cout<<"\n Ur name "<

cout<<"\n\n Registration number is "<

cout<<"\n\n U have to return after 5 days";

// cout<<"\n\nUr date of returning book is "<

// showdetails();

// else cout<<"Wrong entered";

} }

getch();

} }

else cout<<" \nPlease add ";

getch();

}

int lib::fine;

int lib::da;

//Return book function as that of issue book function it is similarly controlling the return book part of function it is containing return book related information ie datamembers etc.

void lib::returnbook()

{ lib l[100];

int n;

cout<<"\n\nHow many books are there ";

cin>>n;

for(int i=0;i

{

cout<<"\n\nEnter ur book name ";

cin>>l[i].bname;

cout<<"\n\nEnter ur book code ";

cin>>l[i].bcode;

}

cout<<"\n\nHow many days late ";

cin>>da;

fine=da*5;

cout<<"\n\nPay Fine Rs "<

cout<<"\n\n Success fully returned ";

getch();

}

//Void mainmenu function this function is used for showing a menu screen so that program can be menu driven. User just have to enter or press key what he has to do hence it is a menudriven program.

void lib:: mainmenu()

{

char ch;

int p;

while(1)

{

clrscr();

cout<<"\nLIBRARY MANAGEMENT SYSTEM- BOOK ";

cout<<"\n-------------------------------";

cout<<"\n1.Introduction";

cout<<"\n2.Add Book(s)";

cout<<"\n3.Issue book";

cout<<"\n4.Return Book(s)";

cout<<"\n5.List of Book(s)";

cout<<"\n0.QUIT";

cout<<"\nEnter Your Choice: ";

flushall();

ch=getchar();

if(ch=='1')

introduc();

else

if(ch=='3')

issuebook();

else if(ch=='2')

addbook();

else

if(ch=='0')

break;

else

if(ch=='4')

returnbook();

} }

//This function is containing introduction of the program.

void lib::introduc ()

{

clrscr();

char stylestr[40];

cout<<"\nINTRODUCTION";

cout<<"\nLIBRARY MANGEMENT";

cout<<"\nThis software is made by Rajat Jain";

cout<<" this software is for library management";

cout<<" ie wnever u want to issue book from lib.";

cout<<" just have to enter few entry & that are";

cout<<" related to book and student who wants to";

cout<<" issue book he will get the return date.";

cout<<" If he wants to return book it'll check";

cout<<" whether u are returning on date or not";

cout<<" if not u will be fined ocassionally.";

getch();

}

//Book found this function helps a user to find a book it automatically executes when a user press key or fulfill the required fields so it is helpful user to know whether the book is available or not.

int lib::bookfound(int tcode)

{

fstream file;

file.open("lib.DAT",ios::in);

file.seekg(0,ios::beg);

int found=0;

while(file.read((char *)this,sizeof(lib)))

{

if(bcode==tcode)

{

found=1;

break;

}

}

file.close();

return found;

}

//Add new book function this function is used for adding new book ie if there are no books available then a user can add book. User just have to enter book code with book name.

void lib::addnewbook(int tcode,char tname[33],int tavail)

{

fstream file;

file.open("lib.DAT",ios::out);

file.write((char *)this,sizeof(lib));

bcode=tcode;

strcpy(name,tname);

avail=tavail;

file.close();

}

TESTING ( Screenshots of working program):-

Testing is very important part of programming as everything is executed and checked before we assure that our program is successfully generated and hence testing is needed.

In this context I have snapped few pictures of working model of my program.

THESE ARE THE FEW SCREENSHOTS OF WORKING MODEL. WHERE WE CAN ADD BOOKS AND MEMBERS AS WELL. LATER ON IN THE FOLLOWING PROGRAM WE ALSO COME ACROSS ISSUING AND RETURNING BOOKS OPTIONS.

Further Readings (Future Scope):-

The Working model of program can help lots of maintainer of library and can reduce their efforts. This program can be implemented in any kind of educational institutes and also several kind of library stores.

Still the program can be converted with lots of add on options and functionality, which can enhance the procedure of library handling in professional manner.

REFERENCE(BIBLIOGRAPHY)

Ø E. BALAGURUSAMY, text book of C++

Ø YASHWANT KANEDKAR, REFERENCE OF C++

Ø LPU LIBRARY FOR THE CURRENT FUNCTIONALILTY & AMANGEMENT

Ø PROGRAMMING STRUCTURE> Various websites.


No comments:

Post a Comment