SlideShare a Scribd company logo
1 of 42
………………………………………………
…
Project Report
On
LIBRARY
MANAGEMENT
SYSTEM
……………………
…
ACKNOWLEDGEMENT
I would like to convey my heartful thanks to
………………….(Computer Science) who
always gave valuable suggestions & guidance
for completion of my project.
He helped me to understand & remember
important details of the project. My project has
been a success only because of his guidance.
I am especially indented & I am also beholden
to my friends. And finally I thank to the
members of my family for their support &
encouragement.
CERTIFICATE
This is to certify that ………………….. of
………… of ………………………… has
completed his project under my supervision.
He has taken proper care & shown sincerity
in completion of this project.
I certify that this project is up to my
expectation & as per the guideline issued by
CBSE.
……………………………
(Computer Science faculty )
Content
1. Introduction
2. Source Code
3. Output
4. Requirement
5. Advantages and disadvantages
6. Conclusion
7. System design
Introduction
The project is designed for school library in C++. The
title of the project is Library management system. In
this project a student can issue one book from library.
He has to submit it before 5 days. Otherwise fine will be
charged @ Re. 2/- for each day.
Administrator of the project can enter new book record,
display all/specific student record, he can modify and
delete student record. Administrator can enter new book
record, display all books modify book delete book
This project LIBRARY MANAGEMENT SYSTEM includes some
facilities of travel such as registration, search, display,
modification, delete etc. This software searches the
client data which is store in the record.
The software used for small schools for maintaining
there records related to library and cost savings.
//***************************************************************
// HEADER FILE USED IN PROJECT
//****************************************************************
#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
#include<ctype.h>
//********************functions names*************************************
void intro();int checkpass();void admin_menu();
void intromain();void student_info();void books_info();
void books_transcations();void reports();void write_student();
int getrollno();void modify_student_record(int n);void delete_student_record(int n);
void display_allstud_tabularform();void student_tabular();
void write_books();int getbookno();void modify_books_record(int n);
void delete_books_record(int n);void books_tabular();
void display_allbooks_tabularform();void write_transcation();
int gettransno();int getresult(int stno);void displaybooks(int bkno,int c);
int getposlimit(int n);void displaybookslimits();
void transaction();void return_transaction(int trno);
int getfineno();void booksofchoice(int bkno1);
void displaybookslimitswithstud(); void studentdetailbooks(int stno);
void studentdetailreturnbooks(int sno);
//************************************************************************
struct finemoney
{ int fno;
int stdno;
int total;
};
struct dateofissued
{ int dd;
int mm;
int yy;
};
struct bookslimit
{
int blno;
int bookno;
int limit;
};
struct fine
{
int fno;
int transno;
int studentno;
int fine;
};
//******************transcations class ***********************************
class trans
{ int tno; int studno; int bookno;
dateofissued dateiss,datereturn;
char status; public:
int gettno() { return tno; }
int getstudno()
{ return studno; }
int getbookno()
{ return bookno; }
dateofissued getdateiss()
{ return dateiss; }
dateofissued getdate()
{ return datereturn; }
char getstatus()
{ return status;}
void setstatus(char s1)
{ status=s1; }
void settrans(int t1,int stno,int bkno,dateofissued d1,dateofissued dret1,char stt)
{ tno=t1; studno=stno; bookno=bkno; dateiss=d1; datereturn=dret1; status=stt;
}
void showalltrans(int c)
{ gotoxy(3,c);
cout<<tno<<setw(10)<<studno<<setw(10)<<bookno<<setw(15)<<dateiss.dd<<"-"<<dateiss.mm<<"-“<<dateiss.yy
<<setw(15)<<datereturn.dd<<"-"<<datereturn.mm<<"-"<<datereturn.yy<<setw(10)<<status;
}};
//*******************transcation class ************************************
//*****************books class ******************************************
class books
{ int bno;
char booknm[25]; char pub[25]; char author[25];
float price; int qty;
public: int getbkno() { return bno; }
char *getbknm() { return booknm; }
char *getpub() { return pub; }
char *getauthor() { return author; }
float getprice() { return price; }
int getqty() { return qty; }
void setqty(int q1) { qty=q1; }
void setprice(float p) { price=p; }
//*************************add the book*******************************
void bookaddrecord(int bn)
{ gotoxy(5,7);
cout<<"======================================================================";
gotoxy(10,8); cout<<"BOOK NO:";
bno=bn; gotoxy(24,8); cout<<bno; gotoxy(10,9);
cout<<"----------------------------------------------------------------------";
gotoxy(10,10); cout<<"NAME OF BOOK:";
gotoxy(35,10); cin>>booknm;
gotoxy(10,11); cout<<"PUBLISHERS NAME";
gotoxy(35,11); cin>>pub;
gotoxy(10,12); cout<<"AUTHORS NAME";
gotoxy(35,12); cin>>author;
gotoxy(10,13); cout<<"PRICE:";
gotoxy(35,13); cin>>price;
gotoxy(10,14); cout<<"QUANTITY";
gotoxy(35,14); cin>>qty;
gotoxy(35,15);
cout<<"======================================================================";
} //*************************add the book*******************************
//********************show books record multiple
void showdatamulti_bk()
{ gotoxy(5,7);
cout<<"======================================================================";
gotoxy(8,8); cout<<"BOOK NO:";
gotoxy(25,8); cout<<bno;
gotoxy(35,8); cout<<"NAME OF BOOK:";
gotoxy(55,8); cout<<booknm;
gotoxy(8,9); cout<<"PUBLISHERS NAME";
gotoxy(30,9); cout<<pub;
gotoxy(40,9); cout<<"AUTHOR:";
gotoxy(55,9); cout<<author;
gotoxy(8,10); cout<<"PRICE";
gotoxy(25,10); cout<<price;
gotoxy(40,10); cout<<"QUANTITY:";
gotoxy(55,10); cout<<qty;
gotoxy(5,11); cout<<"=====================================================================";
}//********************show books record multiple
void modifydatabooks(int b1,char bknm[25],char p[25],char auth[25],float pr,int q1);
//****************show record of books tabular form*************************
//cout<<"NO."<<setw(15)<<"BOOK NAME"<<"--"<<"PUBLISHER" <<setw(25) <<"AUTHOR" <<setw(20)
<<"PRICE"<<setw(20)<<"QUANT.";
void showonlybooks(int c,int tqty)
{ gotoxy(1,c); cout<<bno<<setw(15)<<booknm<<"--"<<pub<<setw(20)<<author<<setw(10)<<tqty;
}
//******************only book no,name ,pub,author
void showallbooks(int c)
{ gotoxy(1,c);
cout<<bno<<setw(20)<<booknm<<"--"<<pub<<setw(20)<<author<<setw(10)<<price<<setw(10)<<qty;
}};
//************************modify the books ***********************************
void books::modifydatabooks(int b1,char bknm[25],char p[25],char auth[25],float pr,int q1)
{
char tmpnm[25],tmpnm2[25],tmpclass[25];
gotoxy(5,14);
cout<<"===================WANT TO MODIFY ===============================";
gotoxy(10,15); cout<<"BOOK NO:";
bno=b1; gotoxy(25,15);
cout<<bno; gotoxy(40,15); strcpy(booknm,bknm);
cout<<"BOOK NAME:"; gotoxy(60,15); cout<<booknm;
gotoxy(10,17); cout<<"Want to change the Book Name";
gotoxy(50,17); int flag=0;
while(1)
{ gets(tmpnm);
if(strlen(tmpnm)!=0)
{flag=1; break; }
if(strlen(tmpnm)==0)
{ flag=0; break;}
}
if(flag==1)
{ strcpy(booknm,tmpnm); }
gotoxy(5,18); strcpy(pub,p); //****************TO BE MODIFY
cout<<"PUBLISHER:"; gotoxy(20,18); cout<<pub; gotoxy(35,18); cout<<"Want to change the Publisher";
gotoxy(65,18); flag=0;
while(1)
{ gets(tmpnm2);
if(strlen(tmpnm2)!=0)
{ flag=1; break; }
if(strlen(tmpnm2)==0)
{ flag=0; break; }
}
if(flag==1) { strcpy(pub,tmpnm2); }
//*****************class to be modify
gotoxy(5,19); strcpy(author,auth);
//****************TO BE MODIFY
cout<<"AUTHOR:"; gotoxy(20,19); cout<<author; gotoxy(35,19);
cout<<"Want to change the Author Name"; gotoxy(65,19); flag=0;
while(1)
{ gets(tmpclass);
if(strlen(tmpclass)!=0)
{ flag=1; break; }
if(strlen(tmpclass)==0)
{ flag=0; break; }
} if(flag==1)
{ strcpy(author,tmpclass); }
gotoxy(5,20); cout<<"PRICE:"; price=pr;
//****************TO BE MODIFY
gotoxy(20,20); cout<<price; gotoxy(35,20); cout<<"Want to change the Price";
gotoxy(65,20); flag=0; float tmppr=0.00;
while(1)
{ cin>>tmppr;
if(tmppr!=0) { flag=1; break; }
if(tmppr==0) { flag=0; break; }
} if(flag==1)
{ price=tmppr; }gotoxy(5,21); cout<<"QUANTITY:"; qty=q1;
//****************TO BE MODIFY
gotoxy(20,21); cout<<qty; gotoxy(35,21); cout<<"Want to change the Quantity";
gotoxy(65,21); flag=0; int tmpq1=0;
while(1)
{ cin>>tmpq1;
if(tmpq1!=0) { flag=1; break; }
if(tmpq1==0) { flag=0; break; }
} if(flag==1)
{ qty=tmpq1; }
gotoxy(5,22); cout<<"============================================================";
}
class student
{
int stno;
char fname[15],lname[15];
char stud_class[5];
char sec[3];
public:
int getstudno() { return stno; }
char *getfname() { return fname;}
char *getlname() { return lname;}
char *getclass() { return stud_class; }
char *getsec() { return sec;}
void showallstud(int c)
{ gotoxy(1,c); cout<<stno<<setw(18)<<fname<<"-"<<lname<<setw(20)<<stud_class<<setw(15)<<sec;
}
void studentaddrecord(int sno)
{
gotoxy(5,7); cout<<"==============================================================";
gotoxy(10,8); cout<<"STUDENT NO:";
stno=sno; gotoxy(24,8); cout<<stno; gotoxy(10,9);
cout<<"----------------------------------------------------------------------";
gotoxy(25,10); cout<<"NAME OF STUDENT:"; gotoxy(10,11); cout<<"FIRST NAME:";
gotoxy(25,11); cin>>fname; gotoxy(45,11); cout<<"LAST NAME";
gotoxy(58,11); cin>>lname; gotoxy(10,12); cout<<"CLASS[I,....,XII]:";
gotoxy(38,12); cin>>stud_class; gotoxy(10,13); cout<<"SECTION";
gotoxy(25,13); cin>>sec; gotoxy(35,14);
cout<<"============================================================";
}
void showdatamulti()
{
gotoxy(5,7); cout<<"==============================================================";
gotoxy(10,8); cout<<"STUDENT NO:"; gotoxy(30,8); cout<<stno;
gotoxy(40,8); cout<<"FIRST NAME:"; gotoxy(60,8); cout<<fname;
gotoxy(10,9); cout<<"LAST NAME"; gotoxy(30,9); cout<<lname;
gotoxy(40,9); cout<<"STUDENT CLASS:"; gotoxy(60,9); cout<<stud_class;
gotoxy(10,10); cout<<"SECTION"; gotoxy(30,10); cout<<sec;
gotoxy(5,11); cout<<"============================================================";
}
//******************STUDENT MODIFY ************************************
void modifydata(int n1,char fnm[15],char lnm[15],char class_nm[5],char sec_nm[3]);
int getrno() { return stno; }};
void student::modifydata(int n1,char fnm[15],char lnm[15],char class_nm[5],char sec_nm[3])
{char tmpnm[40],tmpnm2[40],tmpclass[5],tmpsec[3];
gotoxy(5,14); cout<<"==============WANT TO MODIFY ===============================";
gotoxy(10,15); cout<<"STUDENT NO:"; stno=n1; gotoxy(25,15);
cout<<stno; gotoxy(40,15); strcpy(fname,fnm); cout<<"FIRST NAME:";
gotoxy(60,15); cout<<fname; gotoxy(10,17); cout<<"Want to change the First Name";
gotoxy(50,17); int flag=0;
while(1)
{gets(tmpnm);
if(strlen(tmpnm)!=0)
{ flag=1; break; }
if(strlen(tmpnm)==0)
{ flag=0; break; }
} if(flag==1)
{ strcpy(fname,tmpnm); }
gotoxy(5,18); strcpy(lname,lnm);
//****************COMPANY NAME TO BE MODIFY
cout<<"LAST NAME:"; gotoxy(20,18); cout<<lname; gotoxy(35,18);
cout<<"Want to change the Last Name"; gotoxy(65,18); flag=0;
while(1)
{ gets(tmpnm2);
if(strlen(tmpnm2)!=0) {
flag=1; break; }
if(strlen(tmpnm2)==0) { flag=0; break; }
}
if(flag==1)
{ strcpy(lname,tmpnm2); } //*****************class to be modify
gotoxy(5,19); strcpy(stud_class,class_nm);
//****************CLASS NAME TO BE MODIFY
cout<<"CLASS NAME:"; gotoxy(20,19); cout<<stud_class; gotoxy(35,19);
cout<<"Want to change the Class Name"; gotoxy(65,19); flag=0;
while(1)
{ gets(tmpclass);
if(strlen(tmpclass)!=0)
{ flag=1; break; }
if(strlen(tmpclass)==0)
{ flag=0; break; }
}
if(flag==1)
{ strcpy(stud_class,tmpclass); }
//****************************************************
gotoxy(5,20); cout<<"SECTION:"; strcpy(sec,sec_nm);
//****************CLASS SEC TO BE MODIFY
gotoxy(20,20); cout<<sec; gotoxy(35,20); cout<<"Want to change the Section";
gotoxy(65,20); flag=0;
while(1)
{ gets(tmpsec);
if(strlen(tmpsec)!=0)
{flag=1;break; }
if(strlen(tmpsec)==0)
{ flag=0; break; }
}
if(flag==1) { strcpy(sec,tmpsec); }
gotoxy(5,22); cout<<"=====================================================";
}//*********************welcome page*************************************
void intro()
{ clrscr(); gotoxy(4,2);
cout<<"***************************LIBRARY MANAGEMENT***************************";
gotoxy(12,4); cout<<"===========================================================";
gotoxy(5,5); cout<<"*********************S=Y=S=T=E=M********************************";
gotoxy(50,10); cout<<"PROJECT:";
gotoxy(50,12); cout<<"MADE BY : …………………………………………………………………";
gotoxy(8,14); cout<<"--------------------DOON PUBLIC SCHOOL,HALDWANI------------------------";
gotoxy(8,15); cout<<"------------------CLASS : XII B ( COMPUTER SCIENCE )-------------------";
getch();
}
void main()
{
char ch; intro();
if(checkpass()==0)
{ do {
clrscr(); intromain();
gotoxy(20,6);cout<<"=================MAIN MENU====================";
gotoxy(28,7);cout<<"01. REPORT GENERATOR";
gotoxy(28,8);cout<<"02. ADMINISTRATOR";
gotoxy(28,9);cout<<"03. EXIT";
gotoxy(20,10);cout<<"==============================================";
gotoxy(25,12);cout<<"Please Select Your Option (1-3) ";
gotoxy(30,14);ch=getche();
switch(ch)
{ case '1': reports(); break;
case '2': admin_menu(); break;
case '3':exit(0);
}
}while(ch!='3');}else{exit(0);}}
//****************************FUNCTIONS STARTS HERE************************
//******************************login name and password****************
int checkpass()
{
char nm[20];
char pass[10];
clrscr();
intromain();
gotoxy(20,20); cout<<"PLEASE ENTER THE USER NAME:";
gotoxy(20,21); cin>>nm; clrscr(); gotoxy(20,20);
cout<<"PLEASE ENTER THE PASSWORD:";
gotoxy(20,21); cin>>pass;
if(strcmp(nm,"admin")==0 && strcmp(pass,"vicky")==0)
{ return 0; }else { return 1; }
}
void intromain()
{ clrscr();
gotoxy(1,2);cout<<"*************LIBRARY****MANAGEMENT*****SYSTEM**********************";
gotoxy(1,3);cout<<"*******************************PROJECT***********************************";
}//**************************admin starts**********************************
void admin_menu()
{
clrscr();
char ch2='0';
clrscr();
intromain();gotoxy(20,6);
cout<<"=================ADMIN MENU====================";
gotoxy(22,7);cout<<"1.STUDENT INFORMATION";
gotoxy(22,8);cout<<"2.BOOKS INFORMATION";
gotoxy(22,9);cout<<"3.TRANSCATIONS";
gotoxy(22,10);cout<<"4.BACK TO MAIN MENU";
gotoxy(22,12);cout<<"Please Enter Your Choice (1-4) ";
gotoxy(23,16); ch2=getche();
switch(ch2)
{
case '1': student_info(); break;
case '2': books_info(); break;
case '3': books_transcations(); break;
case '4': break;
default: cout<<"a"; admin_menu();
}}
//**************************student information system*******************
void student_info()
{
clrscr();
int num;
char ch2='0';
clrscr();
intromain();gotoxy(20,6);
cout<<"=================STUDENT INFORMATION====================";
gotoxy(22,7);cout<<"1.ADD STUDENT INFORMATIONS";
gotoxy(22,8);cout<<"2.MODIFY STUDENT INFORMATIONS";
gotoxy(22,9);cout<<"3.DELETE STUDENT INFORMTIONS";
gotoxy(22,10);cout<<"4.BACK TO MENU";
gotoxy(22,12);cout<<"Please Enter Your Choice (1-4) ";
gotoxy(23,16);ch2=getche();
switch(ch2)
{
case '1':
clrscr(); intromain(); write_student();
break;
case '2':
clrscr();
intromain();
gotoxy(10,8);cout<<"***ENTER THE STUDENT ID TO BE SEARCHED AND MODIFY:";
gotoxy(55,9);cin>>num; modify_student_record(num);
break;
case '3':
clrscr();
intromain();
gotoxy(10,8);cout<<"***ENTER THE STUDENT ID TO BE SEARCHED AND DELETE:";
gotoxy(55,9);cin>>num; delete_student_record(num);
break;
case '4':break;
default:
cout<<"a"; admin_menu();
} }
//*****************books informations*****************************
void books_info()
{
clrscr();
int num=0;
char ch2='0';
clrscr();
intromain();gotoxy(20,6);
cout<<"=================BOOKS INFORMATION====================";
gotoxy(22,7);cout<<"1.ADD BOOKS INFORMATIONS";
gotoxy(22,8);cout<<"2.MODIFY BOOKS INFORMATIONS";
gotoxy(22,9);cout<<"3.DELETE BOOKS INFORMTIONS";
gotoxy(22,10);cout<<"4.BACK TO MENU";
gotoxy(22,12);cout<<"Please Enter Your Choice (1-4) ";
gotoxy(23,16);ch2=getche();
switch(ch2)
{
case '1': clrscr(); intromain(); write_books();
break;
case '2': clrscr(); intromain();
gotoxy(10,8);cout<<"***ENTER THE BOOK NO TO BE SEARCHED AND MODIFY:";
gotoxy(55,9);cin>>num; modify_books_record(num);
break;
case '3': clrscr();
intromain(); gotoxy(10,8);cout<<"***ENTER THE BOOK NO TO BE SEARCHED AND
DELETE:";
gotoxy(55,9);cin>>num; delete_books_record(num);
break;
case '4': break;
default: cout<<"a"; admin_menu();
} }
//*****************books transcations informations*****************************
void books_transcations()
{
clrscr(); char ch2='0';
int tnum=0; clrscr();
intromain();gotoxy(20,6);
cout<<"=================BOOKS TRANSCATIONS====================";
gotoxy(22,7);cout<<"1.ISSUE BOOKS TRANS";
gotoxy(22,8);cout<<"2.SUBMIT BOOKS TRANS";
gotoxy(22,9);cout<<"3.BACK TO MENU";
gotoxy(22,10);cout<<"Please Enter Your Choice (1-3) ";
gotoxy(23,12);ch2=getche();
switch(ch2)
{
case '1': write_transcation(); break;
case '2': clrscr(); intromain();gotoxy(10,8);
cout<<"***ENTER THE TRANS NO TO BE SEARCHED:";
gotoxy(55,9);cin>>tnum; return_transaction(tnum);
break;
case '3': break;
default: cout<<"a"; admin_menu();
} }
//*******************ALL Reports Display Menu************************
void reports()
{
clrscr();
char ch2='0';
int bookno=0,ch3=0,sno=0;
clrscr();
intromain();gotoxy(5,6);
cout<<"================================REPORTS===========================";
gotoxy(10,7);cout<<"1.All books Details";
gotoxy(10,8);cout<<"2.All students Details";
gotoxy(10,9);cout<<"3.Search and Display book details and total books issued";
gotoxy(10,10);cout<<"4.Student details no. of books return with/without fine deposit ";
gotoxy(10,11);cout<<"5.Display Student details With no. of books issued";
gotoxy(10,12);cout<<"6.books with limits and students to whome the book issued";
gotoxy(10,13);cout<<"7.All transcations";
gotoxy(10,14);cout<<"8.BACK TO MENU";
gotoxy(10,15);cout<<"Please Enter Your Choice (1-7) ";
gotoxy(11,16);ch2=getche();
switch(ch2)
{
case '1': books_tabular(); break;
case '2':
student_tabular(); break;
case '3':
clrscr(); intromain();
gotoxy(10,8);cout<<"***ENTER THE BOOK NO TO BE SEARCHED:";
gotoxy(55,9);cin>>bookno; booksofchoice(bookno);
break;
case '4':
clrscr(); intromain();
gotoxy(10,8);cout<<"***ENTER THE STUDENT NO TO BE SEARCHED:";
gotoxy(55,9);cin>>sno; studentdetailreturnbooks(sno);
break;
case '5': clrscr(); intromain();
gotoxy(10,8);cout<<"***ENTER THE STUDENT NO TO BE SEARCHED:";
gotoxy(55,9);cin>>sno; studentdetailbooks(sno);
break;
case '6': clrscr(); intromain();gotoxy(5,6);
cout<<"======================books issued===========================";
gotoxy(5,7);cout<<"1- only limits with bookno 2- book no with student info[Books issued]:";
gotoxy(5,8);cout<<"Enter the choice:";
gotoxy(5,9);cin>>ch3;
switch(ch3)
{
case 1: displaybookslimits(); break;
case 2: displaybookslimitswithstud(); break;
case '7': transaction(); break;
default: cout<<"a"; admin_menu();
} }
//*****************student informations **************************
void write_student()
{
fstream fp;
student st;
fp.open("student.dat",ios::out|ios::app);
clrscr(); intromain();
int rnn=getrollno();
if(rnn>100)
{ rnn=1; }
st.studentaddrecord(rnn);
fp.write((char*)&st,sizeof(student));
fp.close();
gotoxy(10,20); cout<<"***************STUDENTS RECORD SAVED******************* ";
cin.ignore(); getch();
}
//********************check the Student roll number already given or not******
int getrollno()
{
ifstream objiff;
student st;
int count=0,count2=0;
objiff.open("student.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{ cout<<"File could not be open !! Press any Key...";
count=1;getch();
}else{while(objiff.read((char *) &st, sizeof(student)))
{ count2++;}
count=count2;count++;
}objiff.close();return count;}
//******************modify the record*****************************
void modify_student_record(int n)
{
student st,temp;
char tmpfnm[50],tmplnm[50],tmpclass[15],tmpsec[10];
ifstream inFile;
int fpos=-1;inFile.open("student.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch(); }
int flag=0;
while(inFile.read((char *) &st, sizeof(student)))
{ if(st.getrno()==n)
{ clrscr(); intromain(); st.showdatamulti(); flag=1;
}
}
inFile.close();
if(flag==0)
cout<<"nnrecord not exist";
else{
fstream File;
File.open("student.dat",ios::binary|ios::in|ios::out);
if(!File)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
}
while(File.read((char *) &st, sizeof(student)))
{if(st.getrno()==n)
{ fpos=(int)File.tellg();
break; } }
File.seekp(fpos-sizeof(student),ios::beg);
strcpy(tmpfnm,st.getfname()); strcpy(tmplnm,st.getlname());
strcpy(tmpclass,st.getclass()); strcpy(tmpsec,st.getsec());
gotoxy(1,12); cout<<"************************************************************";
gotoxy(1,13);cout<<"=ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE==";
temp.modifydata(n,tmpfnm,tmplnm,tmpclass,tmpsec);
File.write((char *) &temp, sizeof(student)); File.close();
}}
//****************************STUDENTS DETAILS TABULAR FORM ***************************
void display_allstud_tabularform()
{clrscr();
intromain();
gotoxy(1,5);cout<<" **********************STUDENT'S DETAILS***************************";
gotoxy(1,6);cout<<"================================================================";
gotoxy(1,7);cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME" <<setw(20) <<"CLASS" <<setw(15)
<<"SECTION";
gotoxy(1,8);cout<<"===========================================================";
}
//****************************BOOKS DETAILS TABULAR FORM ***************************
void display_allbooks_tabularform()
{clrscr();
intromain();gotoxy(1,5);
cout<<" **********************BOOK'S DETAILS***************************";
gotoxy(1,6);cout<<"====================================================";
gotoxy(1,7);cout<<"NO."<<setw(15)<<"BOOK NAME"<<"--"<<"PUBLISHER"<<setw(20)<<"AUTHOR" <<setw(10)
<<"PRICE"<<setw(10)<<"QUANT.";
gotoxy(1,8);cout<<"=====================================================";
}//******************************************************************************
// DISPLAY ALL THE STUDENTS TABULAR FORM
//******************************************************************************
void student_tabular()
{ int r=0,col=10;
char ss[15];
student s1;
ifstream inFile;
inFile.open("student.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key..."; getch(); return;
}clrscr();
intromain();gotoxy(10,8);cout<<"***ENTER THE CLASS [ I ,II .....XII]:";
gotoxy(55,9); cin>>ss; display_allstud_tabularform();
while(inFile.read((char *) &s1, sizeof(s1)))
{ if(r<=12) { r++;
if(strcmp(ss,s1.getclass())==0)
{ s1.showallstud(col);
col++;
} }else { gotoxy(20,30); cout<<"--------------press any key------------------------";
getch(); clrscr(); display_allstud_tabularform(); col=10; r=0; }}
inFile.close(); getch();
}// DISPLAY ALL THE BOOKS TABULAR FORM
//******************************************************************************
void books_tabular()
{
int r=0,col=10,choice=0,tqty=0;
char ss[15];float plow=0.00;float phig=0.00;books b1;
ifstream inFile; inFile.open("books.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key..."; getch(); return;
}clrscr();
intromain(); gotoxy(5,8); cout<<"***ENTER THE CHOICE:";
gotoxy(5,9); cout<<" 1- ALL BOOKS 2- PUBLISHER WISE 3- AUTHOR WISE ";
gotoxy(5,10); cout<<" 4- PRICE 5- QUANTITY "; gotoxy(10,11); cin>>choice;
switch(choice) { case 1:
//***********************all books*****************************
display_allbooks_tabularform();
while(inFile.read((char *) &b1, sizeof(b1)))
{
if(r<=12) { r++;
b1.showallbooks(col); col++; }else {
gotoxy(20,30); cout<<"--------------press any key------------------------";
getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0;
} } break;
case 2:
//***********************Publisher wise books*****************************
gotoxy(10,13); cout<<"Enter the publisher name";
gotoxy(10,14); cin>>ss;
display_allbooks_tabularform();
while(inFile.read((char *) &b1, sizeof(b1)))
{
if(r<=12)
{ r++;
if(strcmp(ss,b1.getpub())==0)
{ b1.showallbooks(col); col++; } }else {
gotoxy(20,30); cout<<"--------------press any key------------------------";
getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0;
} } break;
//***********************Publisher wise books*****************************
case 3:
//***********************Author wise books*****************************
gotoxy(10,13);cout<<"Enter the Author name";
gotoxy(10,14);cin>>ss; display_allbooks_tabularform();
while(inFile.read((char *) &b1, sizeof(b1)))
{ if(r<=12) { r++;
if(strcmp(ss,b1.getauthor())==0)
{ b1.showallbooks(col); col++; }
}else { gotoxy(20,30); cout<<"--------------press any key------------------------";
getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0;
}} break;
case 4:
//***********************price wise books*****************************
gotoxy(10,13);
cout<<"Enter the price between [lowest and highest]";
gotoxy(10,14); cin>>plow>>phig; display_allbooks_tabularform();
while(inFile.read((char *) &b1, sizeof(b1)))
{ if(r<=12) { r++;
if(b1.getprice()>=plow && b1.getprice()<=phig)
{ b1.showallbooks(col);
col++; } }else {
gotoxy(20,30); cout<<"--------------press any key------------------------";
getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0;
} } break;
case 5:
//***********************quantity wise books*****************************
gotoxy(10,13);cout<<"Enter the quantity:";
gotoxy(10,14);cin>>tqty; display_allbooks_tabularform();
while(inFile.read((char *) &b1, sizeof(b1)))
{ if(r<=12) { r++;
if(b1.getqty()==tqty)
{ b1.showallbooks(col); col++; }
}else { gotoxy(20,30); cout<<"--------------press any key------------------------";
getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0;
}} break;
//***********************quantity wise books*****************************
} inFile.close(); getch();
}
//**************************student deletion***********************************
void delete_student_record(int n)
{
student st;
ifstream inFile;
inFile.open("student.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch(); return;
}
int flag=0;
while(inFile.read((char *) &st, sizeof(student)))
{ if(st.getrno()==n) { clrscr(); intromain(); st.showdatamulti(); flag=1; }
}
inFile.close();
char ch; if(flag==0)
cout<<"nnrecord not exist";
else{
gotoxy(1,15);cout<<"***************************************************************";
gotoxy(5,16);cout<<"=DO YOU WANT TO DELETE THE RECORDS GIVEN ABOVE[YES(Y)ORNO(N)]==";
gotoxy(2,17);cin>>ch;
if (toupper(ch)=='Y')
{ ofstream outFile;
outFile.open("Temp1.dat",ios::binary);
ifstream objiff("student.dat",ios::binary);
objiff.seekg(0,ios::beg);
while(objiff.read((char *) &st, sizeof(student)))
{ if(st.getrno()!=n)
{ outFile.write((char *) &st, sizeof(student));
}}
outFile.close(); objiff.close();
remove("student.dat"); rename("Temp2.dat","student.dat");
gotoxy(30,20); cout<<"----------------------------Record Deleted----------------------------------";
}}getch();
}
void write_books()
{
fstream fp;
books bk;
fp.open("books.dat",ios::out|ios::app);
bookslimit bklimit;
ofstream objoff("blimit.dat",ios::binary|ios::app);
clrscr();
intromain(); int rnn1=getbookno();
if(rnn1>100)
{ rnn1=1; }
bk.bookaddrecord(rnn1);
fp.write((char*)&bk,sizeof(books));
bklimit.blno=rnn1;
bklimit.bookno=rnn1;
bklimit.limit=bk.getqty();
objoff.write((char*)&bklimit,sizeof(bklimit));
objoff.close(); fp.close();
gotoxy(10,20); cout<<"***************BOOKS RECORD SAVED******************* ";
cin.ignore(); getch();
}
//********************check the book number already given or not******
int getbookno()
{
ifstream objiff;
books bk;
int count=0,count2=0;
objiff.open("books.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{ cout<<"File could not be open !! Press any Key...";
count=1;getch();
}else{
//**************temporary hiding these lines
while(objiff.read((char *) &bk, sizeof(books)))
{ count2++; }
count=count2;count++;
}objiff.close();
return count;}
//******************modify the record*****************************
void modify_books_record(int n)
{
books bk,temp;
fstream objf("blimit.dat",ios::binary|ios::in|ios::out);
bookslimit bkslimit;
char tmpbknm[25],tmppubnm[25],tmpauth[15];
float tmpprice=0.00;
int tmpqty=0;
ifstream inFile;
int fpos=-1;
inFile.open("books.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch();
}int flag=0;
while(inFile.read((char *) &bk, sizeof(books)))
{if(bk.getbkno()==n)
{ clrscr(); intromain(); bk.showdatamulti_bk();
flag=1;
}
}
inFile.close();
if(flag==0)
cout<<"nnrecord not exist";
else
{fstream File;
File.open("books.dat",ios::binary|ios::in|ios::out);
if(!File)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
}
while(File.read((char *) &bk, sizeof(books)))
{if(bk.getbkno()==n)
{ fpos=(int)File.tellg();
break;
}
}
File.seekp(fpos-sizeof(books),ios::beg);
strcpy(tmpbknm,bk.getbknm()); strcpy(tmppubnm,bk.getpub());
strcpy(tmpauth,bk.getauthor()); tmpprice=bk.getprice();
int q1=bk.getqty(); tmpqty+=q1;
gotoxy(1,12); cout<<"*************************************************************";
gotoxy(1,13); cout<<"ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=========";
temp.modifydatabooks(n,tmpbknm,tmppubnm,tmpauth,tmpprice,tmpqty);
File.write((char *) &temp, sizeof(books));
int poslimit=getposlimit(n); objf.seekp(poslimit-sizeof(bkslimit));
objf.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit+q1;
objf.seekp(poslimit-sizeof(bkslimit)); objf.write((char*)&bkslimit,sizeof(bkslimit));
objf.close(); File.close();
}}
//******************search for position of book in a file bookslimit.dat
int getposlimit(int n)
{
int p=-1;
ifstream objiff("blimit.dat",ios::binary);
bookslimit bkl;
if(!objiff)
{ cout<<"File could not be open !! Press any Key...";
getch();
}
while(objiff.read((char *) &bkl, sizeof(bkl)))
{if(bkl.bookno==n)
{ p=(int)objiff.tellg();
break;
}
}
return p;
}
void delete_books_record(int n)
{
books bk;
ifstream inFile;
inFile.open("books.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
}
int flag=0;
while(inFile.read((char *) &bk, sizeof(books)))
{if(bk.getbkno()==n)
{ clrscr(); intromain();
bk.showdatamulti_bk(); flag=1;
}
}
inFile.close();
char ch;
if(flag==0)
cout<<"nnrecord not exist";
else
{gotoxy(1,15);
cout<<"*****************************************************************************";
gotoxy(5,16);cout<<"=DO YOU WANT TO DELETE THE RECORDS GIVEN ABOVE[YES(Y) OR NO (N)]=";
gotoxy(2,17); cin>>ch;
if (toupper(ch)=='Y')
{
ofstream outFile;
outFile.open("Temp1.dat",ios::binary);
ifstream objiff("books.dat",ios::binary);
objiff.seekg(0,ios::beg);
while(objiff.read((char *) &bk, sizeof(books)))
{ if(bk.getbkno()!=n)
{ outFile.write((char *) &bk, sizeof(books));
}}
outFile.close(); objiff.close();
remove("books.dat"); rename("Temp2.dat","books.dat");
ifstream objiff2("blimit.dat",ios::binary); ofstream objoff("limitemp.dat",ios::binary);
bookslimit bklimit;
while(objiff2.read((char*)&bklimit,sizeof(bklimit)))
{ if(bklimit.bookno!=n)
{objoff.write((char*)&bklimit,sizeof(bklimit));}
}
objoff.close(); objiff2.close();
remove("blimit.dat");rename("limitemp.dat","blimit.dat");
gotoxy(30,20);cout<<"----------------------------Record Deleted----------------------------------";
} }
getch();
}
void write_transcation()
{ fstream fp;
fp.open("trans.dat",ios::binary|ios::in|ios::out|ios::app);
trans tr;
fstream fplimit("blimit.dat",ios::binary|ios::in|ios::out);
bookslimit bkslimit;
int col=0,flagstud=-1,flagtrans=-1,ch,tmplimit=0,stno=0;
char tmpf[15],tmpl[15],ch2;
books bk; fstream bkobj;
student s1; int tmpstudno=0,bookno=0;
ifstream inFile;
inFile.open("student.dat",ios::binary);
clrscr(); intromain();
int rnn1=gettransno();
if(rnn1>100)
{ rnn1=1;}
clrscr(); intromain();
gotoxy(5,6); cout<<"=========TRANSACTIONS===========================";
gotoxy(5,7); cout<<"Enter the Student 1- First name and Last name 2- student no:";
gotoxy(5,8); cin>>ch;
switch(ch)
{ case 1:
clrscr(); intromain();
gotoxy(5,6); cout<<"==========TRANSACTIONS===========================";
gotoxy(5,7); cout<<"Enter First name and Last name:";
gotoxy(5,8); cin>>tmpf;
cin>>tmpl; if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
} clrscr(); intromain();
gotoxy(5,6);
while(inFile.read((char *) &s1, sizeof(s1)))
{
if(strcmp(tmpf,s1.getfname())==0 && strcmp(tmpl,s1.getlname())==0)
{
tmpstudno=s1.getstudno();
flagstud=1; //flag value is to stop when the record found
break;
} }
if(flagstud==1)
{cout<<"=========================TRANSACTIONS===========================";
//*************************** display_allstud_tabularform()*****************************
gotoxy(1,7); cout<<" **********************STUDENT'S DETAILS***************************";
gotoxy(1,8);cout<<"=================================================================";
gotoxy(1,9); cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS" <<setw(15)
<<"SECTION";
gotoxy(1,10);cout<<"================================================================";
col=11; s1.showallstud(col);
getch(); if(!fp)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
} //comp
//*********************check for how many books issued or not[limits]******************************
col=13; int check=getresult(tmpstudno);
if(check==2)
{ gotoxy(10,12); cout<<"nAlready issued the books upto 3"; }
else if(check==0 || check==1)
{ gotoxy(5,col); cout<<"Enter the book no:";
col++; gotoxy(5,col); cin>>bookno;
//***********************search book*******************************
bkobj.open("books.dat",ios::binary|ios::in|ios::out);
int bkflag=-1;
while(bkobj.read((char *) &bk, sizeof(books)))
{
if(bk.getbkno()==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4))
{ bkflag=1; break; }
}
//********************check for the books available or not from bookslimit file***************
if(bkflag==1)
{
while(fplimit.read((char *) &bkslimit, sizeof(bkslimit)))
{ if(bkslimit.bookno==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4))
{
bkflag=2;break;
} } }
if(bkflag==2)
{ if(bkslimit.limit>0)
{ tmplimit=bkslimit.limit;
bkflag=3;
}else {
bkflag=-3;
} }
if(bkflag==-3)
{clrscr();
gotoxy(10,12);cout<<"OUT OF STOCK";
}
if(bkflag==3)
{ col++; gotoxy(5,col);
cout<<"============================TRANSACTIONS===========================";
col++; gotoxy(1,col);
cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<"--"<<"PUBLISH." <<setw(20)<<"AUTHOR" <<setw(10)
<<"QTY";
col++; bk.showonlybooks(col,tmplimit);
col++;gotoxy(5,col);cout<<"Want to issue this book";
col++;gotoxy(5,col);cin>>ch2;
if(ch2=='y')
{ clrscr(); intromain();
col=10; dateofissued dd1,dd2;
col++; gotoxy(5,col); cout<<"Enter the date of issue[dd - mm - yy]";
col++; gotoxy(5,col); cin>>dd1.dd>>dd1.mm>>dd1.yy;
col++; gotoxy(5,col); cout<<"Enter the date of return[dd - mm - yy]";
col++; gotoxy(5,col); cin>>dd2.dd>>dd2.mm>>dd2.yy;
tr.settrans(rnn1,tmpstudno,bookno,dd1,dd2,'Y');
fp.write((char*)&tr,sizeof(tr));
int poslimit2=getposlimit(bookno); fplimit.seekp(poslimit2-sizeof(bkslimit));
fplimit.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit-1;
fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.write((char*)&bkslimit,sizeof(bkslimit));
flagtrans=1; }}} }
break;
case 2:
clrscr(); intromain();
gotoxy(5,6); cout<<"=============TRANSACTIONS===========================";
gotoxy(5,7); cout<<"Enter Student no:";
gotoxy(5,8); cin>>stno;
if(!inFile)
{cout<<"File could not be open !! Press any Key...";
getch(); }
clrscr(); intromain();
gotoxy(5,6); while(inFile.read((char *) &s1, sizeof(s1)))
{
if(stno==s1.getstudno())
{
tmpstudno=s1.getstudno();
flagstud=1; //flag value is to stop when the record found
break;
} }
if(flagstud==1)
{cout<<"============================TRANSACTIONS===========================";
gotoxy(1,7); cout<<" **********************STUDENT'S DETAILS***************************";
gotoxy(1,8);cout<<"=================================================================";
gotoxy(1,9);cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS"<<setw(15)
<<"SECTION";
gotoxy(1,10);cout<<"================================================================";
col=11; s1.showallstud(col);
getch();if(!fp)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
} //comp
col=13; int check=getresult(tmpstudno);
if(check==2)
{ gotoxy(10,12);cout<<"nAlready issued the books upto 3";
}
else if(check==0 || check==1)
{ gotoxy(5,col);
cout<<"Enter the book no:"; col++;
gotoxy(5,col); cin>>bookno;
bkobj.open("books.dat",ios::binary|ios::in|ios::out);
int bkflag=-1;
while(bkobj.read((char *) &bk, sizeof(books)))
{ if(bk.getbkno()==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4))
{bkflag=1;
break;
} }
//********************check for the books available or not from bookslimit file***************
if(bkflag==1)
{ while(fplimit.read((char *) &bkslimit, sizeof(bkslimit)))
{ if(bkslimit.bookno==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4))
{bkflag=2;
break; } } }
if(bkflag==2)
{ if(bkslimit.limit>0)
{ tmplimit=bkslimit.limit; bkflag=3;
}else { bkflag=-3; } }
//************message that book is out of stock*********************8
if(bkflag==-3)
{ clrscr();
gotoxy(10,12);cout<<"OUT OF STOCK";
}
if(bkflag==3)
{ col++; gotoxy(5,col); cout<<"==================TRANSACTIONS=============";
col++; gotoxy(1,col); cout<<"BOOK
NO"<<setw(10)<<"BOOKNAME"<<"--"<<"PUBLISH."<<setw(20)<<"AUTHOR"<<setw(10)<<"QTY";
col++; bk.showonlybooks(col,tmplimit);
col++; gotoxy(5,col); cout<<"Want to issue this book";
col++; gotoxy(5,col); cin>>ch2;
if(ch2=='y')
{ clrscr(); intromain(); col=10; dateofissued dd1,dd2;
col++; gotoxy(5,col); cout<<"Enter the date of issue[dd - mm - yy]";
col++; gotoxy(5,col); cin>>dd1.dd; gotoxy(15,col); cin>>dd1.mm;
gotoxy(25,col); cin>>dd1.yy; col++; gotoxy(5,col); cout<<"Enter the date of return[dd - mm - yy]";
col++; gotoxy(5,col); cin>>dd2.dd; gotoxy(15,col); cin>>dd2.mm;
gotoxy(25,col); cin>>dd2.yy; tr.settrans(rnn1,tmpstudno,bookno,dd1,dd2,'Y');
fp.write((char*)&tr,sizeof(tr)); int poslimit2=getposlimit(bookno);
fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.read((char*)&bkslimit,sizeof(bkslimit));
bkslimit.limit=bkslimit.limit-1; fplimit.seekp(poslimit2-sizeof(bkslimit));
fplimit.write((char*)&bkslimit,sizeof(bkslimit)); flagtrans=1;
} } } }
break; //****************************search by stud no
} //***********switch closed****************
//*****************************************************************************
if(flagtrans==1)
{clrscr();gotoxy(8,30); cout<<"***************transcation saved******************************";
getch(); }else{
clrscr(); gotoxy(8,30);
cout<<"***************transcation not saved******************************";
getch();
}
fplimit.close(); inFile.close();
fplimit.close(); fp.close();
bkobj.close();
//*****************************************************************************************
}
//********************check the trans number already given or not******
int gettransno()
{ ifstream objiff;
trans tr;
int count=0,count2=0;
objiff.open("trans.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{ cout<<"File could not be open !! Press any Key...";
count=1;getch();
}else{
//**************temporary hiding these lines
while(objiff.read((char *) &tr, sizeof(trans)))
{ count2++; }
count=count2;count++;
}
objiff.close();return count;
}
int getresult(int stno)
{ ifstream objiff;
trans tr;
int count=-1,count2=0;
objiff.open("trans.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{ cout<<"File could not be open !! Press any Key...";
getch();
}else{
//**************temporary hiding these lines
while(objiff.read((char *) &tr, sizeof(trans)))
{ if(tr.getstudno()==stno && tr.getstatus()=='Y')
count2++;
} }
if(count2>=4)
{ count=2;
}else if(count2==0)
{ count=0;
}else
{count=1;
}
objiff.close();
return count;
}
//*****************display books one record at a time********************
void displaybooks(int bkno,int c)
{ books bk;
ifstream inFile;
inFile.open("books.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
}else{
while(inFile.read((char *) &bk, sizeof(books)))
{ if(bk.getbkno()==bkno)
{ bk.showallbooks(c);
break;
}} }
inFile.close();
}
//***********************books limit list
void displaybookslimits()
{ ifstream inFile;
bookslimit bkslimit;
inFile.open("blimit.dat",ios::binary);
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch();
}
clrscr(); intromain();
gotoxy(5,5); int c=6;
cout<<"BNO."<<setw(10)<<"BOOKNO"<<setw(10)<<"BOOKS ISSUED";
while(inFile.read((char *) &bkslimit, sizeof(bkslimit)))
{ gotoxy(5,c); cout<<bkslimit.blno<<setw(10)<<bkslimit.bookno<<setw(10)<<bkslimit.limit;
c++; }
inFile.close(); getch();
}
void displaybookslimitswithstud()
{ student s1;
ifstream stfile;
ifstream objiff; trans tr;
ifstream inFile; bookslimit bkslimit;
inFile.open("blimit.dat",ios::binary);
books bk; ifstream bkfile;
int tmpbkno=0,tmpstdno=0;
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
} clrscr();
intromain();
int c=7;
while(inFile.read((char *) &bkslimit, sizeof(bkslimit)))
{ tmpbkno=bkslimit.bookno;
bkfile.open("books.dat",ios::binary);
while(bkfile.read((char *) &bk, sizeof(books)))
{
if(bk.getbkno()==tmpbkno)
{ break;}
}
bkfile.close();
clrscr();intromain();gotoxy(5,7);
cout<<"=======================================================================";
gotoxy(5,8);cout<<" BOOKS DETAILS";
gotoxy(5,9);cout<<"================================================================";
gotoxy(5,10);cout<<"BOOK NO: "<<bkslimit.bookno<<setw(40)<<"BOOK NAME: "<<bk.getbknm();
gotoxy(5,11);cout<<"BOOK ISSUED :"<<(bk.getqty()-bkslimit.limit)<<setw(35)<<"BOOK TOTAL: "<<bk.getqty();
gotoxy(5,12);cout<<"-----------------------------------------------------------------------";
gotoxy(5,13);cout<<"==================================================================";
gotoxy(5,14);cout<<" STUDENT'S DETAILS";
gotoxy(5,15);cout<<"==================================================================";
gotoxy(10,16);cout<<"STUDENT NAME"<<setw(20)<<"CLASS";
gotoxy(5,17);cout<<"-----------------------------------------------------------------------";
int flag=-1; c=18;
objiff.open("trans.dat",ios::binary);
while(objiff.read((char *) &tr, sizeof(trans)))
{ if(tr.getbookno()==tmpbkno && tr.getstatus()=='Y')
{
tmpstdno=tr.getstudno(); flag=1;}
if(flag==1)
{
gotoxy(20,20);
stfile.open("student.dat",ios::binary);
while(stfile.read((char *) &s1, sizeof(s1)))
{ if(tmpstdno==s1.getstudno())
{break; }
}
gotoxy(5,c);cout<<s1.getfname()<<" "<<s1.getlname()<<setw(20)<<s1.getclass();
c++;gotoxy(5,c); cout<<"-----------------------------------------------------------------------";
c++; flag=-1; stfile.close();
} }
objiff.close();gotoxy(5,c);
cout<<"***********************Press Key To Continue*****************************";
}inFile.close(); getch();
}
void transaction()
{
ifstream inFile;
trans tr;
inFile.open("trans.dat",ios::binary);
if(!inFile)
{cout<<"File could not be open !! Press any Key...";
getch();
} else {
clrscr(); intromain();
gotoxy(1,7); int c=8;
cout<<"TRANSNO"<<setw(10)<<"STUDNO"<<setw(10)<<"BOOKNO"<<setw(20)<<"DATE OF ISSUE"
<<setw(20)<<"DATE OF RETURN"<<setw(10)<<"STATUS";
while(inFile.read((char*) &tr, sizeof(trans)))
{ tr.showalltrans(c); c++;
}}
inFile.close();getch();
}
void return_transaction(int trno)
{ finemoney fine1;
ofstream objfine("fine.dat",ios::binary|ios::app);
books bk; ifstream bkobj;
bkobj.open("books.dat",ios::binary);
student s1; ifstream inFile;
inFile.open("student.dat",ios::binary);
fstream fp; fp.open("trans.dat",ios::binary|ios::in|ios::out);
trans tr; fstream fplimit("blimit.dat",ios::binary|ios::in|ios::out);
bookslimit bkslimit; dateofissued tmpdate,returndate;
int c=8,transflag=-1,tmpstno=0,tmpbkno=0,fineflag=-1,tranpos=0;
if(!fp)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
}clrscr();intromain();
gotoxy(1,7);cout<<"TRANSNO"<<setw(10)<<"STUDNO"<<setw(10)<<"BOOKNO"<<setw(20)<<"DATE OF ISSUE"
<<setw(20)<<"DATE OF RETURN";
while(fp.read((char *) &tr, sizeof(trans)))
{ if(tr.gettno()==trno && tr.getstatus()=='Y')
{ transflag=1;
tranpos=(int)fp.tellg();
break;
}}
if(transflag==1)
{ tr.showalltrans(c); tmpstno=tr.getstudno();
tmpbkno=tr.getbookno(); returndate=tr.getdate();
c++; gotoxy(1,c); cout<<"==============================================================";
c++; gotoxy(1,c); cout<<"=============STUDENT'S DETAIL================================";
c++; gotoxy(1,c); c++;
cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS"<<setw(15)<<"SECTION";
while(inFile.read((char *) &s1, sizeof(s1)))
{ if(tmpstno==s1.getstudno())
{ gotoxy(1,c);
cout<<"==================================================================";
c++; s1.showallstud(c); c++; gotoxy(1,c);
cout<<"==================================================================";
break; }}
c++; gotoxy(1,c);
cout<<"======================================================================";
c++; gotoxy(1,c);
cout<<"===================BOOK'S DETAIL================================";
c++; gotoxy(1,c); c++;
cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<"--"<<"PUBLISH."<<setw(20)<<"AUTHOR"<<setw(10)<<"QTY";
c++;
while(bkobj.read((char *) &bk, sizeof(books)))
{
if(bk.getbkno()==tmpbkno)
{gotoxy(1,c)cout<<"=======================================================================";
c++; bk.showallbooks(c); c++;
gotoxy(1,c);cout<<"=====================================================================";
break; }}
c++; gotoxy(1,c); cout<<"Please enter the returning date of book[dd-mm-yy]";
c++; gotoxy(1,c); cin>>tmpdate.dd;gotoxy(10,c); cin>>tmpdate.mm;gotoxy(20,c);cin>>tmpdate.yy;
int totalmonth=0,totaldays=0,totalfine=0;
if(returndate.yy==tmpdate.yy || returndate.yy!=tmpdate.yy)
{ if(returndate.mm!=tmpdate.mm)
{ totalmonth=tmpdate.mm-returndate.mm;
fineflag=1;
} if(returndate.dd!=tmpdate.dd)
{
totaldays=tmpdate.dd-returndate.dd;
fineflag=1;
}
}else{
c++; gotoxy(10,c); cout<<"you return the book and contact librarian for fine ";
c++; gotoxy(10,c); cin>>totalfine;
fineflag=1;}
if(fineflag==1)
{ int fnn1=getfineno();
if(fnn1>100)
{ fnn1=1; }
totaldays=totaldays+(totalmonth*30);totalfine=totaldays*2;
fine1.fno=fnn1;fine1.stdno=tmpstno;
fine1.total=totalfine;objfine.write((char*)&fine1,sizeof(fine1));
c++; gotoxy(1,c); cout<<"************Total FINE = "<<totalfine;
c++; gotoxy(1,c); cout<<"**********THANKS FOR RETURNING BOOK**********************";
}else{
c++; gotoxy(1,c); cout<<"*********THANKS FOR RETURNING BOOK**********************";
} tr.setstatus('N'); fp.seekp(tranpos-sizeof(trans),ios::beg);
fp.write((char *) &tr, sizeof(trans));
poslimit2=getposlimit(tmpbkno); fplimit.seekp(poslimit2-sizeof(bkslimit));
fplimit.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit+1;
fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.write((char*)&bkslimit,sizeof(bkslimit));
}else{ gotoxy(10,10); cout<<"NO SUCH TRANSCATIONS !!!!!!!!!!!!!!!!!!"; }
objfine.close(); inFile.close(); bkobj.close(); objfine.close(); fp.close(); fplimit.close();
}//**************************return trans
int getfineno()
{ ifstream objiff;
finemoney fine1;
int count=0,count2=0;
objiff.open("fine.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{cout<<"File could not be open !! Press any Key...";
count=1;getch();
}else{
while(objiff.read((char *) &fine1, sizeof(fine1)))
{ count2++;}
count=count2;count++;
}objiff.close();
return count;
}
void booksofchoice(int bkno1)
{ ifstream blim;
bookslimit bkslimit;
blim.open("blimit.dat",ios::binary);
books b1;
ifstream inFile;
inFile.open("books.dat",ios::binary);
int f=-1;
if(!inFile)
{ cout<<"File could not be open !! Press any Key...";
getch(); return;
}
while(inFile.read((char *) &b1, sizeof(books)))
{ if(b1.getbkno()==bkno1)
{f=1; break; }
}if(f==1){ clrscr(); intromain();
b1.showdatamulti_bk();
gotoxy(10,13); cout<<"=============================================================";
gotoxy(20,14); cout<<"*********NO OF BOOKS STILL AVAILABLE**************";
gotoxy(10,15);cout<<"=========================================================";
gotoxy(20,16);cout<<setw(10)<<"-----------------"<<setw(10)<<"BOOKS NOT ISSUED"<<"-----------------";
while(blim.read((char *) &bkslimit, sizeof(bkslimit)))
{
if(bkslimit.bookno==bkno1)
{gotoxy(20,17); cout<<setw(10)<<"-----------------"<<setw(10)<<bkslimit.limit<<"-----------------";
break;}}
}else{ gotoxy(10,20); cout<<"***************no such book********************";
}inFile.close();
getch();
}
void studentdetailbooks(int stno)
{ books bk;
ifstream bkfile;
ifstream objiff;
trans tr; student s1; ifstream inFile;
inFile.open("student.dat",ios::binary);
int c=7; clrscr();
intromain(); gotoxy(1,c);cout<<"========================================================";
c++; gotoxy(1,c); cout<<"============STUDENT'S DETAIL================================";
c++; gotoxy(1,c);
c++; cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS" <<setw(15)
<<"SECTION";
while(inFile.read((char *) &s1, sizeof(s1)))
{ if(stno==s1.getstudno())
{ gotoxy(1,c);
cout<<"================================================================================";
c++; s1.showallstud(c); c++; gotoxy(1,c);
cout<<"================================================================================";
break; }}
c++; inFile.close();
gotoxy(5,c);cout<<"===================================================================";
c++; gotoxy(5,c);cout<<" BOOK'S DETAILS"; c++; gotoxy(5,c);
cout<<"=======================================================================";
c++; gotoxy(5,c); cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<setw(20)<<"ISSUED
DATE"<<setw(20)<<"DATE OF RETURN"<<setw(15)<<"STATUS";
c++; gotoxy(5,c); cout<<"-----------------------------------------------------------------------";
int flag=-1,tmpbkno=0;
c++; objiff.open("trans.dat",ios::binary);
dateofissued tmpdtiss,tmpdtrt;
while(objiff.read((char *) &tr, sizeof(trans)))
{ if(tr.getstudno()==stno)
{ tmpbkno=tr.getbookno(); tmpdtiss=tr.getdateiss(); tmpdtrt=tr.getdate();
flag=1; }
if(flag==1)
{ bkfile.open("books.dat",ios::binary);
while(bkfile.read((char *) &bk, sizeof(books)))
{if(tmpbkno==bk.getbkno())
{ break; } }
gotoxy(5,c);cout<<bk.getbkno();
gotoxy(15,c);cout<<bk.getbknm();
gotoxy(33,c);cout<<tmpdtiss.dd<<"-"<<tmpdtiss.mm<<"-"<<tmpdtiss.yy;
gotoxy(50,c);cout<<tmpdtrt.dd<<"-"<<tmpdtrt.mm<<"-"<<tmpdtrt.yy;
gotoxy(70,c);cout<<tr.getstatus(); c++; gotoxy(5,c);
cout<<"-----------------------------------------------------------------------";
c++;flag=-1; bkfile.close();
} } objiff.close();
gotoxy(5,c);cout<<"******************Press Key To Continue*****************************";
getch();
}
void studentdetailreturnbooks(int sno)
{ books bk;
ifstream bkfile; ifstream objiff;
trans tr; student s1;
ifstream inFile; inFile.open("student.dat",ios::binary);
int c=4; clrscr(); intromain(); gotoxy(1,c);
cout<<"======================================================================";
c++; gotoxy(1,c);
cout<<"===================STUDENT'S DETAIL================================";
c++; gotoxy(1,c); c++;
cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS"<<setw(15)<<"SECTION";
while(inFile.read((char *) &s1, sizeof(s1)))
{ if(sno==s1.getstudno())
{ gotoxy(1,c);
cout<<"================================================================================";
c++; s1.showallstud(c); c++; gotoxy(1,c);
cout<<"================================================================================";
break; }}
c++; inFile.close();
gotoxy(5,c);
cout<<"=======================================================================";
c++; gotoxy(5,c); cout<<" BOOK'S DETAILS";
c++; gotoxy(5,c);cout<<"========================================================";
c++;gotoxy(5,c);cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<setw(20)<<"STATUS"<<setw(15)<<"TOTAL
FINE";
c++; gotoxy(5,c); cout<<"-----------------------------------------------------------------------";
int flag=-1,tmpbkno=0; c++;
objiff.open("trans.dat",ios::binary);
while(objiff.read((char *) &tr, sizeof(trans)))
{ if(tr.getstudno()==sno)
{ tmpbkno=tr.getbookno(); flag=1;}
if(flag==1) { bkfile.open("books.dat",ios::binary);
while(bkfile.read((char *) &bk, sizeof(books)))
{if(tmpbkno==bk.getbkno())
{ break;} }
if(tr.getstatus()!='Y')
{
gotoxy(5,c); cout<<bk.getbkno(); gotoxy(15,c); cout<<bk.getbknm();
gotoxy(30,c); cout<<"RETURNED";//********************fine deposited by the students*****************
finemoney fine1;
ifstream objiffine;
objiffine.open("fine.dat",ios::binary);
while(objiffine.read((char *) &fine1, sizeof(fine1)))
{ if(fine1.stdno==sno)
{ break; }}
//********************fine deposited by the students*****************
gotoxy(50,c); cout<<fine1.total;
c++; gotoxy(5,c);
cout<<"-----------------------------------------------------------------------";
c++; objiffine.close();
}else if(tr.getstatus()=='Y')
{ gotoxy(5,c); cout<<bk.getbkno(); gotoxy(15,c); cout<<bk.getbknm();
gotoxy(30,c); cout<<"NOT RETURNED"; gotoxy(50,c);
cout<<"0.00"; c++; gotoxy(5,c);cout<<"-----------------------------------------------------------------------";
c++;} flag=-1; bkfile.close();
} }
objiff.close(); gotoxy(5,c);
cout<<"***********************Press Key To Continue*****************************";
getch();
}
********************MAIN MENU**********************
==========LIBRARY MANAGEMENT SYSTEM=========
MADE BY: ……………………………………………
SCHOOL : DOON PUBLIC SCHOOL,HALDWANI
=================================================
****************ADMINISTRATOR MENU*********************
*****************************************************************
*******************CREATE STUDENT INFORMATIONS***********************
*****************************************************************
********************* ADD STUDENTS RECORD*****************
********************* MODIFY STUDENTS RECORD*****************
********************* DELETE STUDENTS RECORD*****************
******************* BOOK MENU**********************
*******************ADD BOOKS RECORD**********************
*******************MODIFY BOOKS RECORD**********************
*******************DELETE BOOKS RECORD**********************
*******************BOOKS TRANSCATION MENU**********************
*******************BOOKS ISSUE TRANSCATION**********************
IF CHOICE IS 1:
If choice is “yes”
*******************BOOKS RETURN TRANSCATION**********************
*******************REPORTS**********************
*******************ALL BOOKS DETAILS**********************
If choice is 1 (all books)
*******************ALL STUDENTS DETAILS**********************
***SEARCH & DISPLAY BOOKS DETAILS WITH TOTAL BOOKS ISSUED DETAILS***
*******************STUDENTS DETAILS WITH NO OF BOOKS WITH
FINE***************
*************DISPLAY STUDENT DETAILS WITH NO OF BOOKS ISSUED*********
*******************BOOKS WITH LIMITS & STUDENT DETAILS
**********************
*******************ALL THE TRANSCATIONS**********************
REQUIREMENTS
HARDWARE REQUIRED
• Printer, to print the required documents of the project
• Compact Drive
• Processor : intel
• Ram : 512 MB or more than 512MB
• Harddisk : 80 GB or more than 80GB.
SOFTWARE REQUIRED
• Operating system : Windows XP
• Turbo C++, for execution of program and Ms word, for
presentation of output.
ADVANTAGES
• Students do not have to wait in long queues.
• Librarian does not need to worry about books.
• This software reduces paper work.
• It is easy to handle students’s record.
• It is easily to handle the books records.
• This software saves the time.
• Information of the students stores permanently.
DISADVANTAGES
• This system suitable for only few small schools.
• Online facility is not available.
CONCLUSION
This software is efficient in maintaining customer’s
details and can easily perform operations on customer’s
records. This software also reduces the work load of the
travel agency manager.
In future, this system can launch web site for easy
online registration. In this system there is limitation for
places and vehicles. In future, it can be extended to add
more place and vehicles.
SYSTEM DESIGN
Then we began with the design phase of the system. System design is a
solution, a “HOW TO” approach to the creation of a new system. It translates
system requirements into ways by which they can be made operational. It is a
translational from a user oriented document to a document oriented
programmers. For that, it provides the understanding and procedural details
necessary for the implementation. Here we use Flowchart to supplement the
working of the new system. The system thus made should be reliable, durable
and above all should have least possible maintenance costs. It should
overcome all the drawbacks of the Old existing system and most important of
all meet the user requirements.
Content diagram of Project/FLOWCHART
MAIN MENU
Report generator Administrator
Display all
Books
Student
Info.
Books
Info.
Transcation
Display all
transactions
Display student
details with no. of
books issued
START
LOGIN PAGE
Add Stud.
Mod. Stud.
Del.Stud.
Add Book.
Mod. Book
Del.Book
Issue Books Trans.
Return Books Trans.
Display all
Students
Search&Display
total books issued
Display student details with
return/not return books with
fine or not
Books with limits and
students to whom book
issued

More Related Content

What's hot

Online Shopping System Test case Writing
Online Shopping System Test case WritingOnline Shopping System Test case Writing
Online Shopping System Test case Writingchiragmakdiya
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++vikram mahendra
 
USE CASE DESCRIPTION of Air Ticket Reservation system.docx
USE CASE DESCRIPTION of Air Ticket Reservation system.docxUSE CASE DESCRIPTION of Air Ticket Reservation system.docx
USE CASE DESCRIPTION of Air Ticket Reservation system.docxLatestShorts
 
SRS for student database management system
SRS for student database management systemSRS for student database management system
SRS for student database management systemSuman Saurabh
 
Online Bus Reservation
Online Bus ReservationOnline Bus Reservation
Online Bus ReservationAstha Patel
 
Library management system
Library management systemLibrary management system
Library management systemSHARDA SHARAN
 
Online Library Management
Online Library ManagementOnline Library Management
Online Library ManagementVarsha Sarkar
 
Library mangement system project srs documentation.doc
Library mangement system project srs documentation.docLibrary mangement system project srs documentation.doc
Library mangement system project srs documentation.docjimmykhan
 
SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]
SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]
SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]ayushi goyal
 
College management system ppt
College management system pptCollege management system ppt
College management system pptShanthan Reddy
 
COCOMO Model For Effort Estimation
COCOMO Model For Effort EstimationCOCOMO Model For Effort Estimation
COCOMO Model For Effort Estimationgrandhiprasuna
 
Railway management system, database mini project
Railway management system, database mini projectRailway management system, database mini project
Railway management system, database mini projectshashank reddy
 
Online event registration final review (3-2 project)...
Online event registration final review (3-2 project)...Online event registration final review (3-2 project)...
Online event registration final review (3-2 project)...narrasriram
 
Library Management System Project Report
Library Management System Project Report Library Management System Project Report
Library Management System Project Report Abu Kaisar
 
Final Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-SticaFinal Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-SticaSharath Raj
 
Online Movie Ticket Booking
Online Movie Ticket BookingOnline Movie Ticket Booking
Online Movie Ticket BookingAstha Patel
 
Student Management System report
Student Management System reportStudent Management System report
Student Management System reportChandresh Prasad
 
Payroll Management System SRS
Payroll Management System SRSPayroll Management System SRS
Payroll Management System SRSShubham Modi
 

What's hot (20)

Online Shopping System Test case Writing
Online Shopping System Test case WritingOnline Shopping System Test case Writing
Online Shopping System Test case Writing
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
 
USE CASE DESCRIPTION of Air Ticket Reservation system.docx
USE CASE DESCRIPTION of Air Ticket Reservation system.docxUSE CASE DESCRIPTION of Air Ticket Reservation system.docx
USE CASE DESCRIPTION of Air Ticket Reservation system.docx
 
SRS for student database management system
SRS for student database management systemSRS for student database management system
SRS for student database management system
 
Online Bus Reservation
Online Bus ReservationOnline Bus Reservation
Online Bus Reservation
 
Library management system
Library management systemLibrary management system
Library management system
 
Online Library Management
Online Library ManagementOnline Library Management
Online Library Management
 
Library mangement system project srs documentation.doc
Library mangement system project srs documentation.docLibrary mangement system project srs documentation.doc
Library mangement system project srs documentation.doc
 
SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]
SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]
SCHOOL BUS ROUTING MANAGEMENT SYSTEM [FINAL]
 
College management system ppt
College management system pptCollege management system ppt
College management system ppt
 
COCOMO Model For Effort Estimation
COCOMO Model For Effort EstimationCOCOMO Model For Effort Estimation
COCOMO Model For Effort Estimation
 
Project report
Project reportProject report
Project report
 
Library Management System
Library Management SystemLibrary Management System
Library Management System
 
Railway management system, database mini project
Railway management system, database mini projectRailway management system, database mini project
Railway management system, database mini project
 
Online event registration final review (3-2 project)...
Online event registration final review (3-2 project)...Online event registration final review (3-2 project)...
Online event registration final review (3-2 project)...
 
Library Management System Project Report
Library Management System Project Report Library Management System Project Report
Library Management System Project Report
 
Final Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-SticaFinal Year Project BCA Presentation on Pic-O-Stica
Final Year Project BCA Presentation on Pic-O-Stica
 
Online Movie Ticket Booking
Online Movie Ticket BookingOnline Movie Ticket Booking
Online Movie Ticket Booking
 
Student Management System report
Student Management System reportStudent Management System report
Student Management System report
 
Payroll Management System SRS
Payroll Management System SRSPayroll Management System SRS
Payroll Management System SRS
 

Similar to Library Management System in C

Electricitybillsystemreport
ElectricitybillsystemreportElectricitybillsystemreport
Electricitybillsystemreportvikram mahendra
 
STUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEMSTUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEMvikram mahendra
 
computer project on shopping mall..cbse 2017-2018 project
computer project on shopping mall..cbse 2017-2018 projectcomputer project on shopping mall..cbse 2017-2018 project
computer project on shopping mall..cbse 2017-2018 projectRóhït Ràút
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shopvikram mahendra
 
CANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHONCANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHONvikram mahendra
 
Library Managment System - C++ Program
Library Managment System - C++ ProgramLibrary Managment System - C++ Program
Library Managment System - C++ ProgramMuhammad Danish Badar
 
BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++vikram mahendra
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemvikram mahendra
 
project report on Gas booking system in c++
project report on Gas booking system in c++ project report on Gas booking system in c++
project report on Gas booking system in c++ vikram mahendra
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++vikram mahendra
 
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPradeep Kv
 
SALARY MANAGEMENT SYSTEM IN C++
SALARY MANAGEMENT SYSTEM IN C++SALARY MANAGEMENT SYSTEM IN C++
SALARY MANAGEMENT SYSTEM IN C++vikram mahendra
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Pythonvikram mahendra
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQLvikram mahendra
 
CANTEEN MANAGEMENT SYSTEM IN C++
CANTEEN MANAGEMENT SYSTEM IN C++CANTEEN MANAGEMENT SYSTEM IN C++
CANTEEN MANAGEMENT SYSTEM IN C++vikram mahendra
 

Similar to Library Management System in C (20)

BOOK SHOP SYSTEM C++
BOOK SHOP SYSTEM C++BOOK SHOP SYSTEM C++
BOOK SHOP SYSTEM C++
 
Electricitybillsystemreport
ElectricitybillsystemreportElectricitybillsystemreport
Electricitybillsystemreport
 
STUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEMSTUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEM
 
computer project on shopping mall..cbse 2017-2018 project
computer project on shopping mall..cbse 2017-2018 projectcomputer project on shopping mall..cbse 2017-2018 project
computer project on shopping mall..cbse 2017-2018 project
 
Durgesh
DurgeshDurgesh
Durgesh
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
 
Supermarket
SupermarketSupermarket
Supermarket
 
Python Project on Computer Shop
Python Project on Computer ShopPython Project on Computer Shop
Python Project on Computer Shop
 
CANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHONCANTEEN MANAGEMENT SYSTEM IN PYTHON
CANTEEN MANAGEMENT SYSTEM IN PYTHON
 
Library Managment System - C++ Program
Library Managment System - C++ ProgramLibrary Managment System - C++ Program
Library Managment System - C++ Program
 
BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++
 
Python Project On Cosmetic Shop system
Python Project On Cosmetic Shop systemPython Project On Cosmetic Shop system
Python Project On Cosmetic Shop system
 
project report on Gas booking system in c++
project report on Gas booking system in c++ project report on Gas booking system in c++
project report on Gas booking system in c++
 
Telephone billing system in c++
Telephone billing system in c++Telephone billing system in c++
Telephone billing system in c++
 
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
 
SALARY MANAGEMENT SYSTEM IN C++
SALARY MANAGEMENT SYSTEM IN C++SALARY MANAGEMENT SYSTEM IN C++
SALARY MANAGEMENT SYSTEM IN C++
 
Quiz using C++
Quiz using C++Quiz using C++
Quiz using C++
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
 
project report in C++ programming and SQL
project report in C++ programming and SQLproject report in C++ programming and SQL
project report in C++ programming and SQL
 
CANTEEN MANAGEMENT SYSTEM IN C++
CANTEEN MANAGEMENT SYSTEM IN C++CANTEEN MANAGEMENT SYSTEM IN C++
CANTEEN MANAGEMENT SYSTEM IN C++
 

More from vikram mahendra

PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMvikram mahendra
 
FLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHONFLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHONvikram mahendra
 
FLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONFLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONvikram mahendra
 
FLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONFLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONvikram mahendra
 
OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1vikram mahendra
 
OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2vikram mahendra
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2vikram mahendra
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]vikram mahendra
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONvikram mahendra
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]vikram mahendra
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONvikram mahendra
 

More from vikram mahendra (20)

Communication skill
Communication skillCommunication skill
Communication skill
 
PYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEMPYTHON PROJECT ON CARSHOP SYSTEM
PYTHON PROJECT ON CARSHOP SYSTEM
 
FLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHONFLOW OF CONTROL-NESTED IFS IN PYTHON
FLOW OF CONTROL-NESTED IFS IN PYTHON
 
FLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHONFLOWOFCONTROL-IF..ELSE PYTHON
FLOWOFCONTROL-IF..ELSE PYTHON
 
FLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHONFLOW OF CONTROL-INTRO PYTHON
FLOW OF CONTROL-INTRO PYTHON
 
OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1
 
OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2OPERATOR IN PYTHON-PART2
OPERATOR IN PYTHON-PART2
 
USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2USE OF PRINT IN PYTHON PART 2
USE OF PRINT IN PYTHON PART 2
 
DATA TYPE IN PYTHON
DATA TYPE IN PYTHONDATA TYPE IN PYTHON
DATA TYPE IN PYTHON
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
 
USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
GREEN SKILL[PART-2]
GREEN SKILL[PART-2]GREEN SKILL[PART-2]
GREEN SKILL[PART-2]
 
GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]GREEN SKILLS[PART-1]
GREEN SKILLS[PART-1]
 
Dictionary in python
Dictionary in pythonDictionary in python
Dictionary in python
 
Entrepreneurial skills
Entrepreneurial skillsEntrepreneurial skills
Entrepreneurial skills
 
Boolean logic
Boolean logicBoolean logic
Boolean logic
 
Tuple in python
Tuple in pythonTuple in python
Tuple in python
 

Recently uploaded

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Recently uploaded (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Library Management System in C

  • 2. ACKNOWLEDGEMENT I would like to convey my heartful thanks to ………………….(Computer Science) who always gave valuable suggestions & guidance for completion of my project. He helped me to understand & remember important details of the project. My project has been a success only because of his guidance. I am especially indented & I am also beholden to my friends. And finally I thank to the members of my family for their support & encouragement.
  • 3. CERTIFICATE This is to certify that ………………….. of ………… of ………………………… has completed his project under my supervision. He has taken proper care & shown sincerity in completion of this project. I certify that this project is up to my expectation & as per the guideline issued by CBSE.
  • 5. Content 1. Introduction 2. Source Code 3. Output 4. Requirement 5. Advantages and disadvantages 6. Conclusion 7. System design
  • 6. Introduction The project is designed for school library in C++. The title of the project is Library management system. In this project a student can issue one book from library. He has to submit it before 5 days. Otherwise fine will be charged @ Re. 2/- for each day. Administrator of the project can enter new book record, display all/specific student record, he can modify and delete student record. Administrator can enter new book record, display all books modify book delete book This project LIBRARY MANAGEMENT SYSTEM includes some facilities of travel such as registration, search, display, modification, delete etc. This software searches the client data which is store in the record. The software used for small schools for maintaining there records related to library and cost savings.
  • 7. //*************************************************************** // HEADER FILE USED IN PROJECT //**************************************************************** #include<stdio.h> #include<conio.h> #include<stdio.h> #include<process.h> #include<fstream.h> #include<iomanip.h> #include<string.h> #include<ctype.h> //********************functions names************************************* void intro();int checkpass();void admin_menu(); void intromain();void student_info();void books_info(); void books_transcations();void reports();void write_student(); int getrollno();void modify_student_record(int n);void delete_student_record(int n); void display_allstud_tabularform();void student_tabular(); void write_books();int getbookno();void modify_books_record(int n); void delete_books_record(int n);void books_tabular(); void display_allbooks_tabularform();void write_transcation(); int gettransno();int getresult(int stno);void displaybooks(int bkno,int c); int getposlimit(int n);void displaybookslimits(); void transaction();void return_transaction(int trno); int getfineno();void booksofchoice(int bkno1); void displaybookslimitswithstud(); void studentdetailbooks(int stno); void studentdetailreturnbooks(int sno); //************************************************************************ struct finemoney { int fno; int stdno; int total; }; struct dateofissued { int dd; int mm; int yy; }; struct bookslimit { int blno; int bookno; int limit; }; struct fine { int fno;
  • 8. int transno; int studentno; int fine; }; //******************transcations class *********************************** class trans { int tno; int studno; int bookno; dateofissued dateiss,datereturn; char status; public: int gettno() { return tno; } int getstudno() { return studno; } int getbookno() { return bookno; } dateofissued getdateiss() { return dateiss; } dateofissued getdate() { return datereturn; } char getstatus() { return status;} void setstatus(char s1) { status=s1; } void settrans(int t1,int stno,int bkno,dateofissued d1,dateofissued dret1,char stt) { tno=t1; studno=stno; bookno=bkno; dateiss=d1; datereturn=dret1; status=stt; } void showalltrans(int c) { gotoxy(3,c); cout<<tno<<setw(10)<<studno<<setw(10)<<bookno<<setw(15)<<dateiss.dd<<"-"<<dateiss.mm<<"-“<<dateiss.yy <<setw(15)<<datereturn.dd<<"-"<<datereturn.mm<<"-"<<datereturn.yy<<setw(10)<<status; }}; //*******************transcation class ************************************ //*****************books class ****************************************** class books { int bno; char booknm[25]; char pub[25]; char author[25]; float price; int qty; public: int getbkno() { return bno; } char *getbknm() { return booknm; } char *getpub() { return pub; } char *getauthor() { return author; } float getprice() { return price; } int getqty() { return qty; } void setqty(int q1) { qty=q1; } void setprice(float p) { price=p; } //*************************add the book******************************* void bookaddrecord(int bn) { gotoxy(5,7); cout<<"======================================================================"; gotoxy(10,8); cout<<"BOOK NO:"; bno=bn; gotoxy(24,8); cout<<bno; gotoxy(10,9); cout<<"----------------------------------------------------------------------"; gotoxy(10,10); cout<<"NAME OF BOOK:"; gotoxy(35,10); cin>>booknm; gotoxy(10,11); cout<<"PUBLISHERS NAME"; gotoxy(35,11); cin>>pub; gotoxy(10,12); cout<<"AUTHORS NAME"; gotoxy(35,12); cin>>author; gotoxy(10,13); cout<<"PRICE:"; gotoxy(35,13); cin>>price; gotoxy(10,14); cout<<"QUANTITY"; gotoxy(35,14); cin>>qty; gotoxy(35,15); cout<<"======================================================================"; } //*************************add the book*******************************
  • 9. //********************show books record multiple void showdatamulti_bk() { gotoxy(5,7); cout<<"======================================================================"; gotoxy(8,8); cout<<"BOOK NO:"; gotoxy(25,8); cout<<bno; gotoxy(35,8); cout<<"NAME OF BOOK:"; gotoxy(55,8); cout<<booknm; gotoxy(8,9); cout<<"PUBLISHERS NAME"; gotoxy(30,9); cout<<pub; gotoxy(40,9); cout<<"AUTHOR:"; gotoxy(55,9); cout<<author; gotoxy(8,10); cout<<"PRICE"; gotoxy(25,10); cout<<price; gotoxy(40,10); cout<<"QUANTITY:"; gotoxy(55,10); cout<<qty; gotoxy(5,11); cout<<"====================================================================="; }//********************show books record multiple void modifydatabooks(int b1,char bknm[25],char p[25],char auth[25],float pr,int q1); //****************show record of books tabular form************************* //cout<<"NO."<<setw(15)<<"BOOK NAME"<<"--"<<"PUBLISHER" <<setw(25) <<"AUTHOR" <<setw(20) <<"PRICE"<<setw(20)<<"QUANT."; void showonlybooks(int c,int tqty) { gotoxy(1,c); cout<<bno<<setw(15)<<booknm<<"--"<<pub<<setw(20)<<author<<setw(10)<<tqty; } //******************only book no,name ,pub,author void showallbooks(int c) { gotoxy(1,c); cout<<bno<<setw(20)<<booknm<<"--"<<pub<<setw(20)<<author<<setw(10)<<price<<setw(10)<<qty; }}; //************************modify the books *********************************** void books::modifydatabooks(int b1,char bknm[25],char p[25],char auth[25],float pr,int q1) { char tmpnm[25],tmpnm2[25],tmpclass[25]; gotoxy(5,14); cout<<"===================WANT TO MODIFY ==============================="; gotoxy(10,15); cout<<"BOOK NO:"; bno=b1; gotoxy(25,15); cout<<bno; gotoxy(40,15); strcpy(booknm,bknm); cout<<"BOOK NAME:"; gotoxy(60,15); cout<<booknm; gotoxy(10,17); cout<<"Want to change the Book Name"; gotoxy(50,17); int flag=0; while(1) { gets(tmpnm); if(strlen(tmpnm)!=0) {flag=1; break; } if(strlen(tmpnm)==0) { flag=0; break;} } if(flag==1) { strcpy(booknm,tmpnm); } gotoxy(5,18); strcpy(pub,p); //****************TO BE MODIFY cout<<"PUBLISHER:"; gotoxy(20,18); cout<<pub; gotoxy(35,18); cout<<"Want to change the Publisher"; gotoxy(65,18); flag=0; while(1) { gets(tmpnm2); if(strlen(tmpnm2)!=0) { flag=1; break; } if(strlen(tmpnm2)==0) { flag=0; break; } } if(flag==1) { strcpy(pub,tmpnm2); } //*****************class to be modify gotoxy(5,19); strcpy(author,auth);
  • 10. //****************TO BE MODIFY cout<<"AUTHOR:"; gotoxy(20,19); cout<<author; gotoxy(35,19); cout<<"Want to change the Author Name"; gotoxy(65,19); flag=0; while(1) { gets(tmpclass); if(strlen(tmpclass)!=0) { flag=1; break; } if(strlen(tmpclass)==0) { flag=0; break; } } if(flag==1) { strcpy(author,tmpclass); } gotoxy(5,20); cout<<"PRICE:"; price=pr; //****************TO BE MODIFY gotoxy(20,20); cout<<price; gotoxy(35,20); cout<<"Want to change the Price"; gotoxy(65,20); flag=0; float tmppr=0.00; while(1) { cin>>tmppr; if(tmppr!=0) { flag=1; break; } if(tmppr==0) { flag=0; break; } } if(flag==1) { price=tmppr; }gotoxy(5,21); cout<<"QUANTITY:"; qty=q1; //****************TO BE MODIFY gotoxy(20,21); cout<<qty; gotoxy(35,21); cout<<"Want to change the Quantity"; gotoxy(65,21); flag=0; int tmpq1=0; while(1) { cin>>tmpq1; if(tmpq1!=0) { flag=1; break; } if(tmpq1==0) { flag=0; break; } } if(flag==1) { qty=tmpq1; } gotoxy(5,22); cout<<"============================================================"; } class student { int stno; char fname[15],lname[15]; char stud_class[5]; char sec[3]; public: int getstudno() { return stno; } char *getfname() { return fname;} char *getlname() { return lname;} char *getclass() { return stud_class; } char *getsec() { return sec;} void showallstud(int c) { gotoxy(1,c); cout<<stno<<setw(18)<<fname<<"-"<<lname<<setw(20)<<stud_class<<setw(15)<<sec; } void studentaddrecord(int sno) { gotoxy(5,7); cout<<"=============================================================="; gotoxy(10,8); cout<<"STUDENT NO:"; stno=sno; gotoxy(24,8); cout<<stno; gotoxy(10,9); cout<<"----------------------------------------------------------------------"; gotoxy(25,10); cout<<"NAME OF STUDENT:"; gotoxy(10,11); cout<<"FIRST NAME:"; gotoxy(25,11); cin>>fname; gotoxy(45,11); cout<<"LAST NAME"; gotoxy(58,11); cin>>lname; gotoxy(10,12); cout<<"CLASS[I,....,XII]:"; gotoxy(38,12); cin>>stud_class; gotoxy(10,13); cout<<"SECTION"; gotoxy(25,13); cin>>sec; gotoxy(35,14); cout<<"============================================================"; } void showdatamulti() { gotoxy(5,7); cout<<"=============================================================="; gotoxy(10,8); cout<<"STUDENT NO:"; gotoxy(30,8); cout<<stno;
  • 11. gotoxy(40,8); cout<<"FIRST NAME:"; gotoxy(60,8); cout<<fname; gotoxy(10,9); cout<<"LAST NAME"; gotoxy(30,9); cout<<lname; gotoxy(40,9); cout<<"STUDENT CLASS:"; gotoxy(60,9); cout<<stud_class; gotoxy(10,10); cout<<"SECTION"; gotoxy(30,10); cout<<sec; gotoxy(5,11); cout<<"============================================================"; } //******************STUDENT MODIFY ************************************ void modifydata(int n1,char fnm[15],char lnm[15],char class_nm[5],char sec_nm[3]); int getrno() { return stno; }}; void student::modifydata(int n1,char fnm[15],char lnm[15],char class_nm[5],char sec_nm[3]) {char tmpnm[40],tmpnm2[40],tmpclass[5],tmpsec[3]; gotoxy(5,14); cout<<"==============WANT TO MODIFY ==============================="; gotoxy(10,15); cout<<"STUDENT NO:"; stno=n1; gotoxy(25,15); cout<<stno; gotoxy(40,15); strcpy(fname,fnm); cout<<"FIRST NAME:"; gotoxy(60,15); cout<<fname; gotoxy(10,17); cout<<"Want to change the First Name"; gotoxy(50,17); int flag=0; while(1) {gets(tmpnm); if(strlen(tmpnm)!=0) { flag=1; break; } if(strlen(tmpnm)==0) { flag=0; break; } } if(flag==1) { strcpy(fname,tmpnm); } gotoxy(5,18); strcpy(lname,lnm); //****************COMPANY NAME TO BE MODIFY cout<<"LAST NAME:"; gotoxy(20,18); cout<<lname; gotoxy(35,18); cout<<"Want to change the Last Name"; gotoxy(65,18); flag=0; while(1) { gets(tmpnm2); if(strlen(tmpnm2)!=0) { flag=1; break; } if(strlen(tmpnm2)==0) { flag=0; break; } } if(flag==1) { strcpy(lname,tmpnm2); } //*****************class to be modify gotoxy(5,19); strcpy(stud_class,class_nm); //****************CLASS NAME TO BE MODIFY cout<<"CLASS NAME:"; gotoxy(20,19); cout<<stud_class; gotoxy(35,19); cout<<"Want to change the Class Name"; gotoxy(65,19); flag=0; while(1) { gets(tmpclass); if(strlen(tmpclass)!=0) { flag=1; break; } if(strlen(tmpclass)==0) { flag=0; break; } } if(flag==1) { strcpy(stud_class,tmpclass); } //**************************************************** gotoxy(5,20); cout<<"SECTION:"; strcpy(sec,sec_nm); //****************CLASS SEC TO BE MODIFY gotoxy(20,20); cout<<sec; gotoxy(35,20); cout<<"Want to change the Section"; gotoxy(65,20); flag=0; while(1) { gets(tmpsec); if(strlen(tmpsec)!=0) {flag=1;break; } if(strlen(tmpsec)==0) { flag=0; break; } } if(flag==1) { strcpy(sec,tmpsec); } gotoxy(5,22); cout<<"====================================================="; }//*********************welcome page*************************************
  • 12. void intro() { clrscr(); gotoxy(4,2); cout<<"***************************LIBRARY MANAGEMENT***************************"; gotoxy(12,4); cout<<"==========================================================="; gotoxy(5,5); cout<<"*********************S=Y=S=T=E=M********************************"; gotoxy(50,10); cout<<"PROJECT:"; gotoxy(50,12); cout<<"MADE BY : …………………………………………………………………"; gotoxy(8,14); cout<<"--------------------DOON PUBLIC SCHOOL,HALDWANI------------------------"; gotoxy(8,15); cout<<"------------------CLASS : XII B ( COMPUTER SCIENCE )-------------------"; getch(); } void main() { char ch; intro(); if(checkpass()==0) { do { clrscr(); intromain(); gotoxy(20,6);cout<<"=================MAIN MENU===================="; gotoxy(28,7);cout<<"01. REPORT GENERATOR"; gotoxy(28,8);cout<<"02. ADMINISTRATOR"; gotoxy(28,9);cout<<"03. EXIT"; gotoxy(20,10);cout<<"=============================================="; gotoxy(25,12);cout<<"Please Select Your Option (1-3) "; gotoxy(30,14);ch=getche(); switch(ch) { case '1': reports(); break; case '2': admin_menu(); break; case '3':exit(0); } }while(ch!='3');}else{exit(0);}} //****************************FUNCTIONS STARTS HERE************************ //******************************login name and password**************** int checkpass() { char nm[20]; char pass[10]; clrscr(); intromain(); gotoxy(20,20); cout<<"PLEASE ENTER THE USER NAME:"; gotoxy(20,21); cin>>nm; clrscr(); gotoxy(20,20); cout<<"PLEASE ENTER THE PASSWORD:"; gotoxy(20,21); cin>>pass; if(strcmp(nm,"admin")==0 && strcmp(pass,"vicky")==0) { return 0; }else { return 1; } } void intromain() { clrscr(); gotoxy(1,2);cout<<"*************LIBRARY****MANAGEMENT*****SYSTEM**********************"; gotoxy(1,3);cout<<"*******************************PROJECT***********************************"; }//**************************admin starts********************************** void admin_menu() { clrscr(); char ch2='0'; clrscr(); intromain();gotoxy(20,6); cout<<"=================ADMIN MENU===================="; gotoxy(22,7);cout<<"1.STUDENT INFORMATION"; gotoxy(22,8);cout<<"2.BOOKS INFORMATION"; gotoxy(22,9);cout<<"3.TRANSCATIONS"; gotoxy(22,10);cout<<"4.BACK TO MAIN MENU"; gotoxy(22,12);cout<<"Please Enter Your Choice (1-4) "; gotoxy(23,16); ch2=getche(); switch(ch2)
  • 13. { case '1': student_info(); break; case '2': books_info(); break; case '3': books_transcations(); break; case '4': break; default: cout<<"a"; admin_menu(); }} //**************************student information system******************* void student_info() { clrscr(); int num; char ch2='0'; clrscr(); intromain();gotoxy(20,6); cout<<"=================STUDENT INFORMATION===================="; gotoxy(22,7);cout<<"1.ADD STUDENT INFORMATIONS"; gotoxy(22,8);cout<<"2.MODIFY STUDENT INFORMATIONS"; gotoxy(22,9);cout<<"3.DELETE STUDENT INFORMTIONS"; gotoxy(22,10);cout<<"4.BACK TO MENU"; gotoxy(22,12);cout<<"Please Enter Your Choice (1-4) "; gotoxy(23,16);ch2=getche(); switch(ch2) { case '1': clrscr(); intromain(); write_student(); break; case '2': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE STUDENT ID TO BE SEARCHED AND MODIFY:"; gotoxy(55,9);cin>>num; modify_student_record(num); break; case '3': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE STUDENT ID TO BE SEARCHED AND DELETE:"; gotoxy(55,9);cin>>num; delete_student_record(num); break; case '4':break; default: cout<<"a"; admin_menu(); } } //*****************books informations***************************** void books_info() { clrscr(); int num=0; char ch2='0'; clrscr(); intromain();gotoxy(20,6); cout<<"=================BOOKS INFORMATION===================="; gotoxy(22,7);cout<<"1.ADD BOOKS INFORMATIONS"; gotoxy(22,8);cout<<"2.MODIFY BOOKS INFORMATIONS"; gotoxy(22,9);cout<<"3.DELETE BOOKS INFORMTIONS"; gotoxy(22,10);cout<<"4.BACK TO MENU"; gotoxy(22,12);cout<<"Please Enter Your Choice (1-4) "; gotoxy(23,16);ch2=getche(); switch(ch2) { case '1': clrscr(); intromain(); write_books(); break; case '2': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE BOOK NO TO BE SEARCHED AND MODIFY:";
  • 14. gotoxy(55,9);cin>>num; modify_books_record(num); break; case '3': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE BOOK NO TO BE SEARCHED AND DELETE:"; gotoxy(55,9);cin>>num; delete_books_record(num); break; case '4': break; default: cout<<"a"; admin_menu(); } } //*****************books transcations informations***************************** void books_transcations() { clrscr(); char ch2='0'; int tnum=0; clrscr(); intromain();gotoxy(20,6); cout<<"=================BOOKS TRANSCATIONS===================="; gotoxy(22,7);cout<<"1.ISSUE BOOKS TRANS"; gotoxy(22,8);cout<<"2.SUBMIT BOOKS TRANS"; gotoxy(22,9);cout<<"3.BACK TO MENU"; gotoxy(22,10);cout<<"Please Enter Your Choice (1-3) "; gotoxy(23,12);ch2=getche(); switch(ch2) { case '1': write_transcation(); break; case '2': clrscr(); intromain();gotoxy(10,8); cout<<"***ENTER THE TRANS NO TO BE SEARCHED:"; gotoxy(55,9);cin>>tnum; return_transaction(tnum); break; case '3': break; default: cout<<"a"; admin_menu(); } } //*******************ALL Reports Display Menu************************ void reports() { clrscr(); char ch2='0'; int bookno=0,ch3=0,sno=0; clrscr(); intromain();gotoxy(5,6); cout<<"================================REPORTS==========================="; gotoxy(10,7);cout<<"1.All books Details"; gotoxy(10,8);cout<<"2.All students Details"; gotoxy(10,9);cout<<"3.Search and Display book details and total books issued"; gotoxy(10,10);cout<<"4.Student details no. of books return with/without fine deposit "; gotoxy(10,11);cout<<"5.Display Student details With no. of books issued"; gotoxy(10,12);cout<<"6.books with limits and students to whome the book issued"; gotoxy(10,13);cout<<"7.All transcations"; gotoxy(10,14);cout<<"8.BACK TO MENU"; gotoxy(10,15);cout<<"Please Enter Your Choice (1-7) "; gotoxy(11,16);ch2=getche(); switch(ch2) { case '1': books_tabular(); break; case '2': student_tabular(); break; case '3': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE BOOK NO TO BE SEARCHED:"; gotoxy(55,9);cin>>bookno; booksofchoice(bookno); break; case '4': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE STUDENT NO TO BE SEARCHED:";
  • 15. gotoxy(55,9);cin>>sno; studentdetailreturnbooks(sno); break; case '5': clrscr(); intromain(); gotoxy(10,8);cout<<"***ENTER THE STUDENT NO TO BE SEARCHED:"; gotoxy(55,9);cin>>sno; studentdetailbooks(sno); break; case '6': clrscr(); intromain();gotoxy(5,6); cout<<"======================books issued==========================="; gotoxy(5,7);cout<<"1- only limits with bookno 2- book no with student info[Books issued]:"; gotoxy(5,8);cout<<"Enter the choice:"; gotoxy(5,9);cin>>ch3; switch(ch3) { case 1: displaybookslimits(); break; case 2: displaybookslimitswithstud(); break; case '7': transaction(); break; default: cout<<"a"; admin_menu(); } } //*****************student informations ************************** void write_student() { fstream fp; student st; fp.open("student.dat",ios::out|ios::app); clrscr(); intromain(); int rnn=getrollno(); if(rnn>100) { rnn=1; } st.studentaddrecord(rnn); fp.write((char*)&st,sizeof(student)); fp.close(); gotoxy(10,20); cout<<"***************STUDENTS RECORD SAVED******************* "; cin.ignore(); getch(); } //********************check the Student roll number already given or not****** int getrollno() { ifstream objiff; student st; int count=0,count2=0; objiff.open("student.dat",ios::binary); objiff.seekg(0,ios::beg); if(!objiff) { cout<<"File could not be open !! Press any Key..."; count=1;getch(); }else{while(objiff.read((char *) &st, sizeof(student))) { count2++;} count=count2;count++; }objiff.close();return count;} //******************modify the record***************************** void modify_student_record(int n) { student st,temp; char tmpfnm[50],tmplnm[50],tmpclass[15],tmpsec[10]; ifstream inFile; int fpos=-1;inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); } int flag=0; while(inFile.read((char *) &st, sizeof(student))) { if(st.getrno()==n) { clrscr(); intromain(); st.showdatamulti(); flag=1; }
  • 16. } inFile.close(); if(flag==0) cout<<"nnrecord not exist"; else{ fstream File; File.open("student.dat",ios::binary|ios::in|ios::out); if(!File) { cout<<"File could not be open !! Press any Key..."; getch(); return; } while(File.read((char *) &st, sizeof(student))) {if(st.getrno()==n) { fpos=(int)File.tellg(); break; } } File.seekp(fpos-sizeof(student),ios::beg); strcpy(tmpfnm,st.getfname()); strcpy(tmplnm,st.getlname()); strcpy(tmpclass,st.getclass()); strcpy(tmpsec,st.getsec()); gotoxy(1,12); cout<<"************************************************************"; gotoxy(1,13);cout<<"=ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=="; temp.modifydata(n,tmpfnm,tmplnm,tmpclass,tmpsec); File.write((char *) &temp, sizeof(student)); File.close(); }} //****************************STUDENTS DETAILS TABULAR FORM *************************** void display_allstud_tabularform() {clrscr(); intromain(); gotoxy(1,5);cout<<" **********************STUDENT'S DETAILS***************************"; gotoxy(1,6);cout<<"================================================================"; gotoxy(1,7);cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME" <<setw(20) <<"CLASS" <<setw(15) <<"SECTION"; gotoxy(1,8);cout<<"==========================================================="; } //****************************BOOKS DETAILS TABULAR FORM *************************** void display_allbooks_tabularform() {clrscr(); intromain();gotoxy(1,5); cout<<" **********************BOOK'S DETAILS***************************"; gotoxy(1,6);cout<<"===================================================="; gotoxy(1,7);cout<<"NO."<<setw(15)<<"BOOK NAME"<<"--"<<"PUBLISHER"<<setw(20)<<"AUTHOR" <<setw(10) <<"PRICE"<<setw(10)<<"QUANT."; gotoxy(1,8);cout<<"====================================================="; }//****************************************************************************** // DISPLAY ALL THE STUDENTS TABULAR FORM //****************************************************************************** void student_tabular() { int r=0,col=10; char ss[15]; student s1; ifstream inFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; }clrscr(); intromain();gotoxy(10,8);cout<<"***ENTER THE CLASS [ I ,II .....XII]:"; gotoxy(55,9); cin>>ss; display_allstud_tabularform(); while(inFile.read((char *) &s1, sizeof(s1))) { if(r<=12) { r++; if(strcmp(ss,s1.getclass())==0) { s1.showallstud(col); col++; } }else { gotoxy(20,30); cout<<"--------------press any key------------------------"; getch(); clrscr(); display_allstud_tabularform(); col=10; r=0; }} inFile.close(); getch();
  • 17. }// DISPLAY ALL THE BOOKS TABULAR FORM //****************************************************************************** void books_tabular() { int r=0,col=10,choice=0,tqty=0; char ss[15];float plow=0.00;float phig=0.00;books b1; ifstream inFile; inFile.open("books.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; }clrscr(); intromain(); gotoxy(5,8); cout<<"***ENTER THE CHOICE:"; gotoxy(5,9); cout<<" 1- ALL BOOKS 2- PUBLISHER WISE 3- AUTHOR WISE "; gotoxy(5,10); cout<<" 4- PRICE 5- QUANTITY "; gotoxy(10,11); cin>>choice; switch(choice) { case 1: //***********************all books***************************** display_allbooks_tabularform(); while(inFile.read((char *) &b1, sizeof(b1))) { if(r<=12) { r++; b1.showallbooks(col); col++; }else { gotoxy(20,30); cout<<"--------------press any key------------------------"; getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0; } } break; case 2: //***********************Publisher wise books***************************** gotoxy(10,13); cout<<"Enter the publisher name"; gotoxy(10,14); cin>>ss; display_allbooks_tabularform(); while(inFile.read((char *) &b1, sizeof(b1))) { if(r<=12) { r++; if(strcmp(ss,b1.getpub())==0) { b1.showallbooks(col); col++; } }else { gotoxy(20,30); cout<<"--------------press any key------------------------"; getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0; } } break; //***********************Publisher wise books***************************** case 3: //***********************Author wise books***************************** gotoxy(10,13);cout<<"Enter the Author name"; gotoxy(10,14);cin>>ss; display_allbooks_tabularform(); while(inFile.read((char *) &b1, sizeof(b1))) { if(r<=12) { r++; if(strcmp(ss,b1.getauthor())==0) { b1.showallbooks(col); col++; } }else { gotoxy(20,30); cout<<"--------------press any key------------------------"; getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0; }} break; case 4: //***********************price wise books***************************** gotoxy(10,13); cout<<"Enter the price between [lowest and highest]"; gotoxy(10,14); cin>>plow>>phig; display_allbooks_tabularform(); while(inFile.read((char *) &b1, sizeof(b1))) { if(r<=12) { r++; if(b1.getprice()>=plow && b1.getprice()<=phig) { b1.showallbooks(col); col++; } }else { gotoxy(20,30); cout<<"--------------press any key------------------------"; getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0; } } break; case 5: //***********************quantity wise books*****************************
  • 18. gotoxy(10,13);cout<<"Enter the quantity:"; gotoxy(10,14);cin>>tqty; display_allbooks_tabularform(); while(inFile.read((char *) &b1, sizeof(b1))) { if(r<=12) { r++; if(b1.getqty()==tqty) { b1.showallbooks(col); col++; } }else { gotoxy(20,30); cout<<"--------------press any key------------------------"; getch(); clrscr(); display_allbooks_tabularform(); col=10; r=0; }} break; //***********************quantity wise books***************************** } inFile.close(); getch(); } //**************************student deletion*********************************** void delete_student_record(int n) { student st; ifstream inFile; inFile.open("student.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; } int flag=0; while(inFile.read((char *) &st, sizeof(student))) { if(st.getrno()==n) { clrscr(); intromain(); st.showdatamulti(); flag=1; } } inFile.close(); char ch; if(flag==0) cout<<"nnrecord not exist"; else{ gotoxy(1,15);cout<<"***************************************************************"; gotoxy(5,16);cout<<"=DO YOU WANT TO DELETE THE RECORDS GIVEN ABOVE[YES(Y)ORNO(N)]=="; gotoxy(2,17);cin>>ch; if (toupper(ch)=='Y') { ofstream outFile; outFile.open("Temp1.dat",ios::binary); ifstream objiff("student.dat",ios::binary); objiff.seekg(0,ios::beg); while(objiff.read((char *) &st, sizeof(student))) { if(st.getrno()!=n) { outFile.write((char *) &st, sizeof(student)); }} outFile.close(); objiff.close(); remove("student.dat"); rename("Temp2.dat","student.dat"); gotoxy(30,20); cout<<"----------------------------Record Deleted----------------------------------"; }}getch(); } void write_books() { fstream fp; books bk; fp.open("books.dat",ios::out|ios::app); bookslimit bklimit; ofstream objoff("blimit.dat",ios::binary|ios::app); clrscr(); intromain(); int rnn1=getbookno(); if(rnn1>100) { rnn1=1; } bk.bookaddrecord(rnn1); fp.write((char*)&bk,sizeof(books)); bklimit.blno=rnn1; bklimit.bookno=rnn1; bklimit.limit=bk.getqty();
  • 19. objoff.write((char*)&bklimit,sizeof(bklimit)); objoff.close(); fp.close(); gotoxy(10,20); cout<<"***************BOOKS RECORD SAVED******************* "; cin.ignore(); getch(); } //********************check the book number already given or not****** int getbookno() { ifstream objiff; books bk; int count=0,count2=0; objiff.open("books.dat",ios::binary); objiff.seekg(0,ios::beg); if(!objiff) { cout<<"File could not be open !! Press any Key..."; count=1;getch(); }else{ //**************temporary hiding these lines while(objiff.read((char *) &bk, sizeof(books))) { count2++; } count=count2;count++; }objiff.close(); return count;} //******************modify the record***************************** void modify_books_record(int n) { books bk,temp; fstream objf("blimit.dat",ios::binary|ios::in|ios::out); bookslimit bkslimit; char tmpbknm[25],tmppubnm[25],tmpauth[15]; float tmpprice=0.00; int tmpqty=0; ifstream inFile; int fpos=-1; inFile.open("books.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); }int flag=0; while(inFile.read((char *) &bk, sizeof(books))) {if(bk.getbkno()==n) { clrscr(); intromain(); bk.showdatamulti_bk(); flag=1; } } inFile.close(); if(flag==0) cout<<"nnrecord not exist"; else {fstream File; File.open("books.dat",ios::binary|ios::in|ios::out); if(!File) { cout<<"File could not be open !! Press any Key..."; getch(); return; } while(File.read((char *) &bk, sizeof(books))) {if(bk.getbkno()==n) { fpos=(int)File.tellg(); break; } } File.seekp(fpos-sizeof(books),ios::beg); strcpy(tmpbknm,bk.getbknm()); strcpy(tmppubnm,bk.getpub()); strcpy(tmpauth,bk.getauthor()); tmpprice=bk.getprice();
  • 20. int q1=bk.getqty(); tmpqty+=q1; gotoxy(1,12); cout<<"*************************************************************"; gotoxy(1,13); cout<<"ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE========="; temp.modifydatabooks(n,tmpbknm,tmppubnm,tmpauth,tmpprice,tmpqty); File.write((char *) &temp, sizeof(books)); int poslimit=getposlimit(n); objf.seekp(poslimit-sizeof(bkslimit)); objf.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit+q1; objf.seekp(poslimit-sizeof(bkslimit)); objf.write((char*)&bkslimit,sizeof(bkslimit)); objf.close(); File.close(); }} //******************search for position of book in a file bookslimit.dat int getposlimit(int n) { int p=-1; ifstream objiff("blimit.dat",ios::binary); bookslimit bkl; if(!objiff) { cout<<"File could not be open !! Press any Key..."; getch(); } while(objiff.read((char *) &bkl, sizeof(bkl))) {if(bkl.bookno==n) { p=(int)objiff.tellg(); break; } } return p; } void delete_books_record(int n) { books bk; ifstream inFile; inFile.open("books.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; } int flag=0; while(inFile.read((char *) &bk, sizeof(books))) {if(bk.getbkno()==n) { clrscr(); intromain(); bk.showdatamulti_bk(); flag=1; } } inFile.close(); char ch; if(flag==0) cout<<"nnrecord not exist"; else {gotoxy(1,15); cout<<"*****************************************************************************"; gotoxy(5,16);cout<<"=DO YOU WANT TO DELETE THE RECORDS GIVEN ABOVE[YES(Y) OR NO (N)]="; gotoxy(2,17); cin>>ch; if (toupper(ch)=='Y') { ofstream outFile; outFile.open("Temp1.dat",ios::binary); ifstream objiff("books.dat",ios::binary); objiff.seekg(0,ios::beg); while(objiff.read((char *) &bk, sizeof(books))) { if(bk.getbkno()!=n) { outFile.write((char *) &bk, sizeof(books)); }} outFile.close(); objiff.close();
  • 21. remove("books.dat"); rename("Temp2.dat","books.dat"); ifstream objiff2("blimit.dat",ios::binary); ofstream objoff("limitemp.dat",ios::binary); bookslimit bklimit; while(objiff2.read((char*)&bklimit,sizeof(bklimit))) { if(bklimit.bookno!=n) {objoff.write((char*)&bklimit,sizeof(bklimit));} } objoff.close(); objiff2.close(); remove("blimit.dat");rename("limitemp.dat","blimit.dat"); gotoxy(30,20);cout<<"----------------------------Record Deleted----------------------------------"; } } getch(); } void write_transcation() { fstream fp; fp.open("trans.dat",ios::binary|ios::in|ios::out|ios::app); trans tr; fstream fplimit("blimit.dat",ios::binary|ios::in|ios::out); bookslimit bkslimit; int col=0,flagstud=-1,flagtrans=-1,ch,tmplimit=0,stno=0; char tmpf[15],tmpl[15],ch2; books bk; fstream bkobj; student s1; int tmpstudno=0,bookno=0; ifstream inFile; inFile.open("student.dat",ios::binary); clrscr(); intromain(); int rnn1=gettransno(); if(rnn1>100) { rnn1=1;} clrscr(); intromain(); gotoxy(5,6); cout<<"=========TRANSACTIONS==========================="; gotoxy(5,7); cout<<"Enter the Student 1- First name and Last name 2- student no:"; gotoxy(5,8); cin>>ch; switch(ch) { case 1: clrscr(); intromain(); gotoxy(5,6); cout<<"==========TRANSACTIONS==========================="; gotoxy(5,7); cout<<"Enter First name and Last name:"; gotoxy(5,8); cin>>tmpf; cin>>tmpl; if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); } clrscr(); intromain(); gotoxy(5,6); while(inFile.read((char *) &s1, sizeof(s1))) { if(strcmp(tmpf,s1.getfname())==0 && strcmp(tmpl,s1.getlname())==0) { tmpstudno=s1.getstudno(); flagstud=1; //flag value is to stop when the record found break; } } if(flagstud==1) {cout<<"=========================TRANSACTIONS==========================="; //*************************** display_allstud_tabularform()***************************** gotoxy(1,7); cout<<" **********************STUDENT'S DETAILS***************************"; gotoxy(1,8);cout<<"================================================================="; gotoxy(1,9); cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS" <<setw(15) <<"SECTION"; gotoxy(1,10);cout<<"================================================================"; col=11; s1.showallstud(col); getch(); if(!fp) { cout<<"File could not be open !! Press any Key...";
  • 22. getch(); return; } //comp //*********************check for how many books issued or not[limits]****************************** col=13; int check=getresult(tmpstudno); if(check==2) { gotoxy(10,12); cout<<"nAlready issued the books upto 3"; } else if(check==0 || check==1) { gotoxy(5,col); cout<<"Enter the book no:"; col++; gotoxy(5,col); cin>>bookno; //***********************search book******************************* bkobj.open("books.dat",ios::binary|ios::in|ios::out); int bkflag=-1; while(bkobj.read((char *) &bk, sizeof(books))) { if(bk.getbkno()==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4)) { bkflag=1; break; } } //********************check for the books available or not from bookslimit file*************** if(bkflag==1) { while(fplimit.read((char *) &bkslimit, sizeof(bkslimit))) { if(bkslimit.bookno==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4)) { bkflag=2;break; } } } if(bkflag==2) { if(bkslimit.limit>0) { tmplimit=bkslimit.limit; bkflag=3; }else { bkflag=-3; } } if(bkflag==-3) {clrscr(); gotoxy(10,12);cout<<"OUT OF STOCK"; } if(bkflag==3) { col++; gotoxy(5,col); cout<<"============================TRANSACTIONS==========================="; col++; gotoxy(1,col); cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<"--"<<"PUBLISH." <<setw(20)<<"AUTHOR" <<setw(10) <<"QTY"; col++; bk.showonlybooks(col,tmplimit); col++;gotoxy(5,col);cout<<"Want to issue this book"; col++;gotoxy(5,col);cin>>ch2; if(ch2=='y') { clrscr(); intromain(); col=10; dateofissued dd1,dd2; col++; gotoxy(5,col); cout<<"Enter the date of issue[dd - mm - yy]"; col++; gotoxy(5,col); cin>>dd1.dd>>dd1.mm>>dd1.yy; col++; gotoxy(5,col); cout<<"Enter the date of return[dd - mm - yy]"; col++; gotoxy(5,col); cin>>dd2.dd>>dd2.mm>>dd2.yy; tr.settrans(rnn1,tmpstudno,bookno,dd1,dd2,'Y'); fp.write((char*)&tr,sizeof(tr)); int poslimit2=getposlimit(bookno); fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit-1; fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.write((char*)&bkslimit,sizeof(bkslimit)); flagtrans=1; }}} } break; case 2: clrscr(); intromain(); gotoxy(5,6); cout<<"=============TRANSACTIONS==========================="; gotoxy(5,7); cout<<"Enter Student no:"; gotoxy(5,8); cin>>stno;
  • 23. if(!inFile) {cout<<"File could not be open !! Press any Key..."; getch(); } clrscr(); intromain(); gotoxy(5,6); while(inFile.read((char *) &s1, sizeof(s1))) { if(stno==s1.getstudno()) { tmpstudno=s1.getstudno(); flagstud=1; //flag value is to stop when the record found break; } } if(flagstud==1) {cout<<"============================TRANSACTIONS==========================="; gotoxy(1,7); cout<<" **********************STUDENT'S DETAILS***************************"; gotoxy(1,8);cout<<"================================================================="; gotoxy(1,9);cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS"<<setw(15) <<"SECTION"; gotoxy(1,10);cout<<"================================================================"; col=11; s1.showallstud(col); getch();if(!fp) { cout<<"File could not be open !! Press any Key..."; getch(); return; } //comp col=13; int check=getresult(tmpstudno); if(check==2) { gotoxy(10,12);cout<<"nAlready issued the books upto 3"; } else if(check==0 || check==1) { gotoxy(5,col); cout<<"Enter the book no:"; col++; gotoxy(5,col); cin>>bookno; bkobj.open("books.dat",ios::binary|ios::in|ios::out); int bkflag=-1; while(bkobj.read((char *) &bk, sizeof(books))) { if(bk.getbkno()==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4)) {bkflag=1; break; } } //********************check for the books available or not from bookslimit file*************** if(bkflag==1) { while(fplimit.read((char *) &bkslimit, sizeof(bkslimit))) { if(bkslimit.bookno==bookno) //&& (bk.getqty()>0 && bk.getqty()<=4)) {bkflag=2; break; } } } if(bkflag==2) { if(bkslimit.limit>0) { tmplimit=bkslimit.limit; bkflag=3; }else { bkflag=-3; } } //************message that book is out of stock*********************8 if(bkflag==-3) { clrscr(); gotoxy(10,12);cout<<"OUT OF STOCK"; } if(bkflag==3) { col++; gotoxy(5,col); cout<<"==================TRANSACTIONS============="; col++; gotoxy(1,col); cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<"--"<<"PUBLISH."<<setw(20)<<"AUTHOR"<<setw(10)<<"QTY"; col++; bk.showonlybooks(col,tmplimit); col++; gotoxy(5,col); cout<<"Want to issue this book"; col++; gotoxy(5,col); cin>>ch2; if(ch2=='y') { clrscr(); intromain(); col=10; dateofissued dd1,dd2; col++; gotoxy(5,col); cout<<"Enter the date of issue[dd - mm - yy]";
  • 24. col++; gotoxy(5,col); cin>>dd1.dd; gotoxy(15,col); cin>>dd1.mm; gotoxy(25,col); cin>>dd1.yy; col++; gotoxy(5,col); cout<<"Enter the date of return[dd - mm - yy]"; col++; gotoxy(5,col); cin>>dd2.dd; gotoxy(15,col); cin>>dd2.mm; gotoxy(25,col); cin>>dd2.yy; tr.settrans(rnn1,tmpstudno,bookno,dd1,dd2,'Y'); fp.write((char*)&tr,sizeof(tr)); int poslimit2=getposlimit(bookno); fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit-1; fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.write((char*)&bkslimit,sizeof(bkslimit)); flagtrans=1; } } } } break; //****************************search by stud no } //***********switch closed**************** //***************************************************************************** if(flagtrans==1) {clrscr();gotoxy(8,30); cout<<"***************transcation saved******************************"; getch(); }else{ clrscr(); gotoxy(8,30); cout<<"***************transcation not saved******************************"; getch(); } fplimit.close(); inFile.close(); fplimit.close(); fp.close(); bkobj.close(); //***************************************************************************************** } //********************check the trans number already given or not****** int gettransno() { ifstream objiff; trans tr; int count=0,count2=0; objiff.open("trans.dat",ios::binary); objiff.seekg(0,ios::beg); if(!objiff) { cout<<"File could not be open !! Press any Key..."; count=1;getch(); }else{ //**************temporary hiding these lines while(objiff.read((char *) &tr, sizeof(trans))) { count2++; } count=count2;count++; } objiff.close();return count; } int getresult(int stno) { ifstream objiff; trans tr; int count=-1,count2=0; objiff.open("trans.dat",ios::binary); objiff.seekg(0,ios::beg); if(!objiff) { cout<<"File could not be open !! Press any Key..."; getch(); }else{ //**************temporary hiding these lines while(objiff.read((char *) &tr, sizeof(trans))) { if(tr.getstudno()==stno && tr.getstatus()=='Y') count2++; } } if(count2>=4) { count=2; }else if(count2==0) { count=0; }else {count=1;
  • 25. } objiff.close(); return count; } //*****************display books one record at a time******************** void displaybooks(int bkno,int c) { books bk; ifstream inFile; inFile.open("books.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; }else{ while(inFile.read((char *) &bk, sizeof(books))) { if(bk.getbkno()==bkno) { bk.showallbooks(c); break; }} } inFile.close(); } //***********************books limit list void displaybookslimits() { ifstream inFile; bookslimit bkslimit; inFile.open("blimit.dat",ios::binary); if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); } clrscr(); intromain(); gotoxy(5,5); int c=6; cout<<"BNO."<<setw(10)<<"BOOKNO"<<setw(10)<<"BOOKS ISSUED"; while(inFile.read((char *) &bkslimit, sizeof(bkslimit))) { gotoxy(5,c); cout<<bkslimit.blno<<setw(10)<<bkslimit.bookno<<setw(10)<<bkslimit.limit; c++; } inFile.close(); getch(); } void displaybookslimitswithstud() { student s1; ifstream stfile; ifstream objiff; trans tr; ifstream inFile; bookslimit bkslimit; inFile.open("blimit.dat",ios::binary); books bk; ifstream bkfile; int tmpbkno=0,tmpstdno=0; if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; } clrscr(); intromain(); int c=7; while(inFile.read((char *) &bkslimit, sizeof(bkslimit))) { tmpbkno=bkslimit.bookno; bkfile.open("books.dat",ios::binary); while(bkfile.read((char *) &bk, sizeof(books))) { if(bk.getbkno()==tmpbkno) { break;} } bkfile.close(); clrscr();intromain();gotoxy(5,7); cout<<"======================================================================="; gotoxy(5,8);cout<<" BOOKS DETAILS"; gotoxy(5,9);cout<<"================================================================";
  • 26. gotoxy(5,10);cout<<"BOOK NO: "<<bkslimit.bookno<<setw(40)<<"BOOK NAME: "<<bk.getbknm(); gotoxy(5,11);cout<<"BOOK ISSUED :"<<(bk.getqty()-bkslimit.limit)<<setw(35)<<"BOOK TOTAL: "<<bk.getqty(); gotoxy(5,12);cout<<"-----------------------------------------------------------------------"; gotoxy(5,13);cout<<"=================================================================="; gotoxy(5,14);cout<<" STUDENT'S DETAILS"; gotoxy(5,15);cout<<"=================================================================="; gotoxy(10,16);cout<<"STUDENT NAME"<<setw(20)<<"CLASS"; gotoxy(5,17);cout<<"-----------------------------------------------------------------------"; int flag=-1; c=18; objiff.open("trans.dat",ios::binary); while(objiff.read((char *) &tr, sizeof(trans))) { if(tr.getbookno()==tmpbkno && tr.getstatus()=='Y') { tmpstdno=tr.getstudno(); flag=1;} if(flag==1) { gotoxy(20,20); stfile.open("student.dat",ios::binary); while(stfile.read((char *) &s1, sizeof(s1))) { if(tmpstdno==s1.getstudno()) {break; } } gotoxy(5,c);cout<<s1.getfname()<<" "<<s1.getlname()<<setw(20)<<s1.getclass(); c++;gotoxy(5,c); cout<<"-----------------------------------------------------------------------"; c++; flag=-1; stfile.close(); } } objiff.close();gotoxy(5,c); cout<<"***********************Press Key To Continue*****************************"; }inFile.close(); getch(); } void transaction() { ifstream inFile; trans tr; inFile.open("trans.dat",ios::binary); if(!inFile) {cout<<"File could not be open !! Press any Key..."; getch(); } else { clrscr(); intromain(); gotoxy(1,7); int c=8; cout<<"TRANSNO"<<setw(10)<<"STUDNO"<<setw(10)<<"BOOKNO"<<setw(20)<<"DATE OF ISSUE" <<setw(20)<<"DATE OF RETURN"<<setw(10)<<"STATUS"; while(inFile.read((char*) &tr, sizeof(trans))) { tr.showalltrans(c); c++; }} inFile.close();getch(); } void return_transaction(int trno) { finemoney fine1; ofstream objfine("fine.dat",ios::binary|ios::app); books bk; ifstream bkobj; bkobj.open("books.dat",ios::binary); student s1; ifstream inFile; inFile.open("student.dat",ios::binary); fstream fp; fp.open("trans.dat",ios::binary|ios::in|ios::out); trans tr; fstream fplimit("blimit.dat",ios::binary|ios::in|ios::out); bookslimit bkslimit; dateofissued tmpdate,returndate; int c=8,transflag=-1,tmpstno=0,tmpbkno=0,fineflag=-1,tranpos=0; if(!fp) { cout<<"File could not be open !! Press any Key..."; getch(); return; }clrscr();intromain();
  • 27. gotoxy(1,7);cout<<"TRANSNO"<<setw(10)<<"STUDNO"<<setw(10)<<"BOOKNO"<<setw(20)<<"DATE OF ISSUE" <<setw(20)<<"DATE OF RETURN"; while(fp.read((char *) &tr, sizeof(trans))) { if(tr.gettno()==trno && tr.getstatus()=='Y') { transflag=1; tranpos=(int)fp.tellg(); break; }} if(transflag==1) { tr.showalltrans(c); tmpstno=tr.getstudno(); tmpbkno=tr.getbookno(); returndate=tr.getdate(); c++; gotoxy(1,c); cout<<"=============================================================="; c++; gotoxy(1,c); cout<<"=============STUDENT'S DETAIL================================"; c++; gotoxy(1,c); c++; cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS"<<setw(15)<<"SECTION"; while(inFile.read((char *) &s1, sizeof(s1))) { if(tmpstno==s1.getstudno()) { gotoxy(1,c); cout<<"=================================================================="; c++; s1.showallstud(c); c++; gotoxy(1,c); cout<<"=================================================================="; break; }} c++; gotoxy(1,c); cout<<"======================================================================"; c++; gotoxy(1,c); cout<<"===================BOOK'S DETAIL================================"; c++; gotoxy(1,c); c++; cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<"--"<<"PUBLISH."<<setw(20)<<"AUTHOR"<<setw(10)<<"QTY"; c++; while(bkobj.read((char *) &bk, sizeof(books))) { if(bk.getbkno()==tmpbkno) {gotoxy(1,c)cout<<"======================================================================="; c++; bk.showallbooks(c); c++; gotoxy(1,c);cout<<"====================================================================="; break; }} c++; gotoxy(1,c); cout<<"Please enter the returning date of book[dd-mm-yy]"; c++; gotoxy(1,c); cin>>tmpdate.dd;gotoxy(10,c); cin>>tmpdate.mm;gotoxy(20,c);cin>>tmpdate.yy; int totalmonth=0,totaldays=0,totalfine=0; if(returndate.yy==tmpdate.yy || returndate.yy!=tmpdate.yy) { if(returndate.mm!=tmpdate.mm) { totalmonth=tmpdate.mm-returndate.mm; fineflag=1; } if(returndate.dd!=tmpdate.dd) { totaldays=tmpdate.dd-returndate.dd; fineflag=1; } }else{ c++; gotoxy(10,c); cout<<"you return the book and contact librarian for fine "; c++; gotoxy(10,c); cin>>totalfine; fineflag=1;} if(fineflag==1) { int fnn1=getfineno(); if(fnn1>100) { fnn1=1; } totaldays=totaldays+(totalmonth*30);totalfine=totaldays*2; fine1.fno=fnn1;fine1.stdno=tmpstno; fine1.total=totalfine;objfine.write((char*)&fine1,sizeof(fine1)); c++; gotoxy(1,c); cout<<"************Total FINE = "<<totalfine; c++; gotoxy(1,c); cout<<"**********THANKS FOR RETURNING BOOK**********************"; }else{ c++; gotoxy(1,c); cout<<"*********THANKS FOR RETURNING BOOK**********************"; } tr.setstatus('N'); fp.seekp(tranpos-sizeof(trans),ios::beg);
  • 28. fp.write((char *) &tr, sizeof(trans)); poslimit2=getposlimit(tmpbkno); fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.read((char*)&bkslimit,sizeof(bkslimit)); bkslimit.limit=bkslimit.limit+1; fplimit.seekp(poslimit2-sizeof(bkslimit)); fplimit.write((char*)&bkslimit,sizeof(bkslimit)); }else{ gotoxy(10,10); cout<<"NO SUCH TRANSCATIONS !!!!!!!!!!!!!!!!!!"; } objfine.close(); inFile.close(); bkobj.close(); objfine.close(); fp.close(); fplimit.close(); }//**************************return trans int getfineno() { ifstream objiff; finemoney fine1; int count=0,count2=0; objiff.open("fine.dat",ios::binary); objiff.seekg(0,ios::beg); if(!objiff) {cout<<"File could not be open !! Press any Key..."; count=1;getch(); }else{ while(objiff.read((char *) &fine1, sizeof(fine1))) { count2++;} count=count2;count++; }objiff.close(); return count; } void booksofchoice(int bkno1) { ifstream blim; bookslimit bkslimit; blim.open("blimit.dat",ios::binary); books b1; ifstream inFile; inFile.open("books.dat",ios::binary); int f=-1; if(!inFile) { cout<<"File could not be open !! Press any Key..."; getch(); return; } while(inFile.read((char *) &b1, sizeof(books))) { if(b1.getbkno()==bkno1) {f=1; break; } }if(f==1){ clrscr(); intromain(); b1.showdatamulti_bk(); gotoxy(10,13); cout<<"============================================================="; gotoxy(20,14); cout<<"*********NO OF BOOKS STILL AVAILABLE**************"; gotoxy(10,15);cout<<"========================================================="; gotoxy(20,16);cout<<setw(10)<<"-----------------"<<setw(10)<<"BOOKS NOT ISSUED"<<"-----------------"; while(blim.read((char *) &bkslimit, sizeof(bkslimit))) { if(bkslimit.bookno==bkno1) {gotoxy(20,17); cout<<setw(10)<<"-----------------"<<setw(10)<<bkslimit.limit<<"-----------------"; break;}} }else{ gotoxy(10,20); cout<<"***************no such book********************"; }inFile.close(); getch(); } void studentdetailbooks(int stno) { books bk; ifstream bkfile; ifstream objiff; trans tr; student s1; ifstream inFile; inFile.open("student.dat",ios::binary); int c=7; clrscr(); intromain(); gotoxy(1,c);cout<<"========================================================"; c++; gotoxy(1,c); cout<<"============STUDENT'S DETAIL================================"; c++; gotoxy(1,c);
  • 29. c++; cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS" <<setw(15) <<"SECTION"; while(inFile.read((char *) &s1, sizeof(s1))) { if(stno==s1.getstudno()) { gotoxy(1,c); cout<<"================================================================================"; c++; s1.showallstud(c); c++; gotoxy(1,c); cout<<"================================================================================"; break; }} c++; inFile.close(); gotoxy(5,c);cout<<"==================================================================="; c++; gotoxy(5,c);cout<<" BOOK'S DETAILS"; c++; gotoxy(5,c); cout<<"======================================================================="; c++; gotoxy(5,c); cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<setw(20)<<"ISSUED DATE"<<setw(20)<<"DATE OF RETURN"<<setw(15)<<"STATUS"; c++; gotoxy(5,c); cout<<"-----------------------------------------------------------------------"; int flag=-1,tmpbkno=0; c++; objiff.open("trans.dat",ios::binary); dateofissued tmpdtiss,tmpdtrt; while(objiff.read((char *) &tr, sizeof(trans))) { if(tr.getstudno()==stno) { tmpbkno=tr.getbookno(); tmpdtiss=tr.getdateiss(); tmpdtrt=tr.getdate(); flag=1; } if(flag==1) { bkfile.open("books.dat",ios::binary); while(bkfile.read((char *) &bk, sizeof(books))) {if(tmpbkno==bk.getbkno()) { break; } } gotoxy(5,c);cout<<bk.getbkno(); gotoxy(15,c);cout<<bk.getbknm(); gotoxy(33,c);cout<<tmpdtiss.dd<<"-"<<tmpdtiss.mm<<"-"<<tmpdtiss.yy; gotoxy(50,c);cout<<tmpdtrt.dd<<"-"<<tmpdtrt.mm<<"-"<<tmpdtrt.yy; gotoxy(70,c);cout<<tr.getstatus(); c++; gotoxy(5,c); cout<<"-----------------------------------------------------------------------"; c++;flag=-1; bkfile.close(); } } objiff.close(); gotoxy(5,c);cout<<"******************Press Key To Continue*****************************"; getch(); } void studentdetailreturnbooks(int sno) { books bk; ifstream bkfile; ifstream objiff; trans tr; student s1; ifstream inFile; inFile.open("student.dat",ios::binary); int c=4; clrscr(); intromain(); gotoxy(1,c); cout<<"======================================================================"; c++; gotoxy(1,c); cout<<"===================STUDENT'S DETAIL================================"; c++; gotoxy(1,c); c++; cout<<"NO."<<setw(18)<<"FIRST NAME"<<"-"<<"LAST NAME"<<setw(20)<<"CLASS"<<setw(15)<<"SECTION"; while(inFile.read((char *) &s1, sizeof(s1))) { if(sno==s1.getstudno()) { gotoxy(1,c); cout<<"================================================================================"; c++; s1.showallstud(c); c++; gotoxy(1,c); cout<<"================================================================================"; break; }} c++; inFile.close(); gotoxy(5,c); cout<<"======================================================================="; c++; gotoxy(5,c); cout<<" BOOK'S DETAILS"; c++; gotoxy(5,c);cout<<"========================================================"; c++;gotoxy(5,c);cout<<"BOOK NO"<<setw(10)<<"BOOKNAME"<<setw(20)<<"STATUS"<<setw(15)<<"TOTAL FINE";
  • 30. c++; gotoxy(5,c); cout<<"-----------------------------------------------------------------------"; int flag=-1,tmpbkno=0; c++; objiff.open("trans.dat",ios::binary); while(objiff.read((char *) &tr, sizeof(trans))) { if(tr.getstudno()==sno) { tmpbkno=tr.getbookno(); flag=1;} if(flag==1) { bkfile.open("books.dat",ios::binary); while(bkfile.read((char *) &bk, sizeof(books))) {if(tmpbkno==bk.getbkno()) { break;} } if(tr.getstatus()!='Y') { gotoxy(5,c); cout<<bk.getbkno(); gotoxy(15,c); cout<<bk.getbknm(); gotoxy(30,c); cout<<"RETURNED";//********************fine deposited by the students***************** finemoney fine1; ifstream objiffine; objiffine.open("fine.dat",ios::binary); while(objiffine.read((char *) &fine1, sizeof(fine1))) { if(fine1.stdno==sno) { break; }} //********************fine deposited by the students***************** gotoxy(50,c); cout<<fine1.total; c++; gotoxy(5,c); cout<<"-----------------------------------------------------------------------"; c++; objiffine.close(); }else if(tr.getstatus()=='Y') { gotoxy(5,c); cout<<bk.getbkno(); gotoxy(15,c); cout<<bk.getbknm(); gotoxy(30,c); cout<<"NOT RETURNED"; gotoxy(50,c); cout<<"0.00"; c++; gotoxy(5,c);cout<<"-----------------------------------------------------------------------"; c++;} flag=-1; bkfile.close(); } } objiff.close(); gotoxy(5,c); cout<<"***********************Press Key To Continue*****************************"; getch(); }
  • 31.
  • 32. ********************MAIN MENU********************** ==========LIBRARY MANAGEMENT SYSTEM========= MADE BY: …………………………………………… SCHOOL : DOON PUBLIC SCHOOL,HALDWANI ================================================= ****************ADMINISTRATOR MENU********************* ***************************************************************** *******************CREATE STUDENT INFORMATIONS*********************** ***************************************************************** ********************* ADD STUDENTS RECORD***************** ********************* MODIFY STUDENTS RECORD*****************
  • 33. ********************* DELETE STUDENTS RECORD***************** ******************* BOOK MENU********************** *******************ADD BOOKS RECORD**********************
  • 34. *******************MODIFY BOOKS RECORD********************** *******************DELETE BOOKS RECORD********************** *******************BOOKS TRANSCATION MENU********************** *******************BOOKS ISSUE TRANSCATION********************** IF CHOICE IS 1:
  • 35. If choice is “yes” *******************BOOKS RETURN TRANSCATION********************** *******************REPORTS**********************
  • 36. *******************ALL BOOKS DETAILS********************** If choice is 1 (all books) *******************ALL STUDENTS DETAILS********************** ***SEARCH & DISPLAY BOOKS DETAILS WITH TOTAL BOOKS ISSUED DETAILS*** *******************STUDENTS DETAILS WITH NO OF BOOKS WITH FINE***************
  • 37. *************DISPLAY STUDENT DETAILS WITH NO OF BOOKS ISSUED********* *******************BOOKS WITH LIMITS & STUDENT DETAILS ********************** *******************ALL THE TRANSCATIONS**********************
  • 38. REQUIREMENTS HARDWARE REQUIRED • Printer, to print the required documents of the project • Compact Drive • Processor : intel • Ram : 512 MB or more than 512MB • Harddisk : 80 GB or more than 80GB. SOFTWARE REQUIRED • Operating system : Windows XP • Turbo C++, for execution of program and Ms word, for presentation of output.
  • 39. ADVANTAGES • Students do not have to wait in long queues. • Librarian does not need to worry about books. • This software reduces paper work. • It is easy to handle students’s record. • It is easily to handle the books records. • This software saves the time. • Information of the students stores permanently. DISADVANTAGES • This system suitable for only few small schools. • Online facility is not available.
  • 40. CONCLUSION This software is efficient in maintaining customer’s details and can easily perform operations on customer’s records. This software also reduces the work load of the travel agency manager. In future, this system can launch web site for easy online registration. In this system there is limitation for places and vehicles. In future, it can be extended to add more place and vehicles.
  • 41. SYSTEM DESIGN Then we began with the design phase of the system. System design is a solution, a “HOW TO” approach to the creation of a new system. It translates system requirements into ways by which they can be made operational. It is a translational from a user oriented document to a document oriented programmers. For that, it provides the understanding and procedural details necessary for the implementation. Here we use Flowchart to supplement the working of the new system. The system thus made should be reliable, durable and above all should have least possible maintenance costs. It should overcome all the drawbacks of the Old existing system and most important of all meet the user requirements.
  • 42. Content diagram of Project/FLOWCHART MAIN MENU Report generator Administrator Display all Books Student Info. Books Info. Transcation Display all transactions Display student details with no. of books issued START LOGIN PAGE Add Stud. Mod. Stud. Del.Stud. Add Book. Mod. Book Del.Book Issue Books Trans. Return Books Trans. Display all Students Search&Display total books issued Display student details with return/not return books with fine or not Books with limits and students to whom book issued