Sei sulla pagina 1di 50

DESIGN PATTERNS

M.TECH SOFTWARE ENGINEERING (INTERGRATED)

SCHOOL OF INFORMATION TECHNOLOGY


AND ENGINEERING
REVIEW 1
“LIBRARY MANAGEMENT SYSTEM”

SUBMITTED BY: -

• JAGADEESHWARAN.J (17MIS0400)
• AKASH VANAN.A (17MIS0255)
• SHATE BHARATH (17MS0452)
• MAGESH S.V (17MIS0280)

UNDER THE GUIDANCE OF: -

Dr. SENTHILKUMAR.M

School of information technology and engineering

VIT
ABSTRACT:
Library management system is a project which aims in developing a
computerized system to maintain all the daily work of library .This project has
many features which are generally not availiable in normal library management
systems like facility of user login and a facility of teachers login .It also has a
facility of admin login through which the admin can monitor the whole system
.It also has facility of an online notice board where teachers can student can put
up information about workshops or seminars being held in our colleges or
nearby colleges and librarian after proper verification from the concerned
institution organizing the seminar can add it to the notice board . These features
are carried with the design pattern concept and process of the library
management system
LITERATURE SURVEY:
{1} In this paper, They describe the design of a web-based application
developed to assist universities to have a depository that contains all
graduation projects' documentations that senior students undertake. This
will aims to develop a system to provide complete search functionalities
of all stored graduation project documents in a centralized database.
System functionality includes viewing, downloading and borrowing
graduation project documents as well as guidelines to assist students in
preparing these documents. It also includes a borrowing system that can
emulate a real library system within the department, whereas every
available document in the database can be borrowed physically for
viewing. This will discuss how this system serves the organization with a
cost-effective and efficient method for managing graduation project
documents for faculty and students.

{2} Reviews the literature on computer simulation modeling for library


management and examines whether simulation is underutilized because
the models are too complex and mathematical. Other problems with
implementation are considered, including incomplete problem definition,
lack of a conceptual framework, system constraints, lack of interaction
between managers and researchers, and traditional attitudes.

{3} Here they applied theoretical perspectives such as “social


constructionism” and “connected knowing” to the analysis of our own
online classes as well as the growing learning community of other
Moodle users. They used the mode of participatory action research,
including techniques such as case studies, ethnography, learning
environment surveys and design methodologies. This ongoing analysis is
being used to guide the development of Moodle as a tool for improving
processes within communities of reflective inquiry. At the time of writing
(April 2003), Moodle has been translated into twenty-seven languages
and is being used by many hundreds of educators around the world,
including universities, schools and independent teachers.

{4} Many college libraries have implemented knowledge management


which has emerged as an issue that library administrators have to deal
with. In order to evaluate the difference among college library's
knowledge management practices, it is necessary to build a knowledge
management maturity model. Based on the concept of continuous process
improvement and the Capability Maturity Model (CMM) of the Software
Engineering Institute (SEI), in this paper, a new knowledge management
maturity model is constructed, which can be used to describe how college
libraries support the practices at each maturity level, and provide maturity
paths that college libraries can follow. A college library will be taken as
an example to illustrate the application of this model and discuss how to
support the practices at each maturity level in a certain college library by
using this model.

{5} Building flawless understudy individual credit assessment


framework to assess the understudies' credit, is an effective method for
restraining college library understudies unscrupulous marvel. The credit
framework development in libraries, is a significant framework
advancement. In this paper, a novel assessment list framework show
dependent on AHP for college library the board is given. It is valuable to
institutionalized administration and cost decrease for college library.
Additionally, it is of sure centrality to fabricate the entire social
individual credit framework.

{6} In library administration, they need librarian for management of


books. To lessen curator inconvenience they have created robotization in
library to speedy transport of books utilizing robotic arm. Library
management robotic system is combination of software used to manage
the library database and hardware used to manage the book handling.
This system helps to keep the records of whole transactions of books
available in a library. A robot is modular design of sensor operated
motors to manage the library. Robot acquires the book information from
stored database. The robot gathers the barcode data from the books and
relates the decoded barcode data with the search input. The robot conveys
a standardized identification scanner which gathers the scanner tag
information from the books orchestrated in a vertical way and contrasts
the decoded scanner tag information. Global positioning system is used
for book location finding. This aides and streamlines the occupation of
custodian and lessens the manual routine work done by the library staff.

{7} In order to improve the library instruction program by identifying


and responding to learning problems, a formal pilot assessment was
conducted with a group of 48 students enrolled in a summer 2001 pre-
freshmen program.In the process of designing and executing the
assessment system we changed and improved our teaching methods to
address the learning problems we discovered.The intent was to improve
the library instruction program in their medium-sized university library
by applying what we learned from the pilot to the more typical “one shot”
library instruction sessions.

{8} This study explored the role electronic journals currently play in
faculty’s weekly scholarly reading habits. Survey results indicated that
electronic access to journals,particularly library-funded access is integral
to research activities, with the vast majority of respondents reporting they
read at least one article from an electronic source every week.

{9} This investigation investigates contrasts in the scholastic library


utilization of Asian American, African American, Latino, Native
American and White students. The outcomes demonstrated that
understudies of shading announced progressively scholarly library use,
while all students, paying little respect to ethnic gathering, who occupied
with composing exercises and read more non-doled out books likewise
revealed more prominent scholastic library use.

{10} It Provides a framework for the design and development of an


intranet model based on a consortia approach by the Indian Institutes of
Management (IIM) digital library system that will facilitate information
access and use by providing a single Web-enabled window to users to
their own resources and to sources in other participating institutions.
{11} VLFeat is an open and portable library of computer vision
algorithms. It aims at facilitating fast prototyping and reproducible
research for computer vision scientists and students. It includes rigorous
implementations of common building blocks such as feature detectors,
feature extractors, (hierarchical) k-means clustering, randomized kd-tree
matching, and super-pixelization. The source code and interfaces are fully
documented. The library integrates directly with Matlab, a popular
language for computer vision research.

{12} This paper describes a book placement and book searching method
for performance enhancement of existing library systems in Pakistan. The
book placement mechanism is used to ensure the placement of book
inside the shelf according to assigned code to facilitate manual searching.
The prototype system uses a web camera to capture the title page of the
book. The image is processed to extract the title of the book which is
passed to the database for getting book reference number. Control
commands for cartesian robot are then generated to place the book inside
the shelf. Book searching is carried out with the help of mobile phone
software developed using NetBeans IDE integrated with Java Wireless
Toolkit. The user can search the desired book either by providing title of
book or its author name. The software returns the reference number
containing book code and shelf number describing location of the book.
The user can send this reference number to library station to check the
availability of the book using SMS service of GSM network. The base
station then responds with issuance and return dates of the desired book.

{13} With the advancement of technology,library need for change and


bring the technology to the library in order to retain their customer’s
interest in visiting the library.Thus,in this situation,lbiraries should be
improved as well to facillitate staff or librarian in doing their work
effectively.Introduction to library management system(LMS) in the
library environment assists librarian in doing their work.Integration with
all departments within the library shows how LMS is important in library
environment and this conceptual paper will focus on the impact that the
LMS brings to the library environment.

{14} Android platform is gaining popularity and holds more users than
other platforms. Earlier Librarian needed to keep track of books in a vast
room. But evolution of the computers, smart phones and internet have
made the work much easier. LIBKART application helps the users to
access their required information and queries without the help of
computer or the librarians but through their android devices which saves
their time and energy. In this paper we provide an efficient access over
library system using a Smartphone application named as LIBKART. The
main purpose of this paper is to provide an easy access to library and to
provide details of library books, issue of books and notify the user due
dates of book being issued. The paper also aims at providing a reference
section of books where the books can be downloaded through permission
from admin. The user can access the newspapers on daily basis and can
also download university question papers.

{15} The main objective of this research is “Digital Library”. The


analysis has been done by various methods that make our library more
innovative and dedicative. The different effective techniques are
considered to find the suitable most efficient technique.To make our
library digitalized and more innovative.This Digital library display can be
used for Advertising or providing information at various places like
schools, colleges, government offices.

{16} Bluetooth Library Manager (BLM) is library management software


which can be used in any library for maintaining different functions like
book search, requisition submission, data entry etc. Using the encryption
algorithm we encrypt the password in the client side and the cipher-text
and the username is send over Bluetooth to the server side. The
decryption algorithm is used in the server side to decrypt the cipher-text.
Then the decrypted password is matched with corresponding password of
that user stored in the server side database. The user can successfully log-
in into the system if and only if the password of the database matches
with the decrypted password. The entire database of the library is
implemented in a normalized way. Student can submit their requisition
from there phone without using internet. They can contact their faculties
and classmates via SMS, email or call and vice-versa. A student can
check the availability using this software. She/he can also see the return-
date of any book which is out of stock now and borrowed by another
student. Faculties can also send any notification to any student via email
or SMS.
{17} In this paper they construct a library network management system
which is suitable for the higher vocational college.It is based on B/S
structure with ASP.NET as interface programming language,SQL Server
as DBMS to save database.It has realized the processing of book
purchasing, book cataloging, book circulating, book retrieval and journal
management automation.This system connects to the Internet to make the
reader search information conveniently. It greatly improves the efficiency
of library management and the utilization of books. Analysis and design
of the database is an important part of the development of the library
network management system.

{18} Auto identification and data collection technology is known as


radio frequency identification (RFID) helps to automate business
processes and allow identification of large number of tagged objects such
as books by means of radio waves. It is used in supply chain management
in tracking the movement of inventories, equipments, devices and others.
Most libraries automate the tracking of books and documents by utilizing
the RFID technology in managing the movements of books from shelves
and others. This paper is highlighting the application, requirements,
benefits, challenges and other issues by incorporating RFID in
university/institution library management

{19} Currently, the Information and Communication Technology (ICT)


and related topics such as Internet of Things (IoT) have an essential
influence on all elements of human life.This research proposes an
implementation framework for employing the IoT in renovating the
conventional library systems to become smart online library schemes.
The IoT enables connectivity of a physical object (such as a book or other
text typologies) with the real-time communication technology by using
the RFID tags and tiny sensors. The continuous monitoring of books in
real time and the tracking of labeled objects geographically are some
desirable characteristics that result from the use of the IoT tags.It is
concluded that the IoT-based library management systems will be a
promising structure that can play a vital role in the human data
organization and knowledge access by helping researchers, designers, and
administrators in a more efficient and smarter manner.

{20} Library instruction plays a vital role in facilitating the patrons in


imaginative and artistic thinking about research and information resources.
In the present technological era, libraries need to interact with the patrons
more in order to help them in locating the information resource and
organizing the resources in such a way that the patrons can find their
information with assistance. This study investigates the effectiveness of
library instruction among the Post Graduate students in Bharathidasan
University. The study adopted a survey method and structured
questionnaire was used to collect data from the respondents. The Study
found out that majority of the students were able to make use of the library
resources and services without much help of the library staff.

{21} This project examines information literacy skills among the Library
and Information Science (LIS) professionals in India, pointing out the
benefits and finally makes recommendations to improve the program. This
is considered a very significant issue in view of the fact that it will afford
in India, academic institutions and private organizations such as companies
the understanding of what to improve and the way to improve them as far
as their information literacy is concerned.This study is also important in
view of the fact that it will make data available from the population of
Indian Library and Information Scientists on the information literacy skills
needed by the information professionals in India. Furthermore, it will add
to the literature in this area of library and information science an area which
currently growing and require necessary skills for any information
professionals to be relevant in this digital age.

{22} The impact of the library can be felt at all levels in the education
sector, starting from the grass root, that is, School libraries in primary and
secondary schools to the Academic libraries in the tertiary institutions.
Hence the importance of the library in the educational development of a
country cannot be over-estimated. The library policy objectives have not
been difficult to identify yet elements of the most authoritative of all, that
is, National Policy of Education (NPE); which were approved on
recommendations by the Federal Ministry of Education (FME) is grossly
non-implemented. This paper is a position paper which reviews the aims
of the NPE and the roles librarians play in its implementation. The issues
to be critically analyzed are the national policy on education, the roles of
librarians in its implementation, school library establishment, inspection
and administration.
EXISTING SYSTEM:
System analysis is a detailed study of the various operation performed by
a system and their relationships within and outside of the system. Framework and
their connections inside and outside of the framework. Here the key inquiry is-
what all issues exist in the present framework? What must be done to take care
of the issue? Investigation starts when a client or chief starts an investigation of
the System Analysis is a nitty gritty investigation of the different activities
performed by a program utilizing existing system.During examination,
information gathered on the different documents, choice focuses and exchanges
taken care of by the present framework. The accomplishment of the framework
depends to a great extent on how unmistakably the issue is characterized,
completely examined and legitimately brought out through the decision of
arrangement. A decent investigation model ought to give the instruments of issue
understanding as well as the casing work of the arrangement. Consequently it
ought to be examined completely by gathering information about the framework.
At that point the proposed framework ought to be broke down altogether as per
the requirements.
❖ Add the new record.
❖ Delete the existing.
❖ To check availability of the book.
❖ Manual system.
❖ Update the existing system.
❖ Search.
❖ The librarian has to perform each task automatically.

PROPOSED SYSTEM:
Proposed system is an automated library management system.Proposed
framework is a computerized Library Management System. Through our product
client can include books, seek books, restoration, refresh data, alter data, and
return books in fast time. Our proposed framework has the accompanying points
of interest. The system can search for all the book by title, author or subject,
preview their contents and know if it is available or rental or if not, when it will
be available. All the manual difficulties in managing the library have been
rectified by implementing computerization.
❖ Reduce time and effort required to find books.
❖ Fast access to database.
❖ Make the use of library user friendly and efficient.
❖ Less error.
❖ Improve efficiency and quality of service.
❖ Search facility.
❖ Make more books available for borrow in the long term by completely
digitalizing the reference section.
❖ Look and feel environment.
❖ Quick transaction.

ARCHITECTURAL DIAGRAM:

SOFTWARE USED IN LIBRARY MANAGEMENT SYSTEM


1. Operating system: windows 98,windows XP,windows 7
2. Language: java 7 runtime environment or better
3. Front end: net beans 7.3.1
4. Back end: MySQL server 5.0
HARDWARE USED IN LIBRARY MANAGEMENT SYSTEM
1. Processor: Pentium IV or better
2. Ram:128MB or more
3. Hard disk:20GB
4. Monitor: any
5. Key board:122keys
DESIGN PATTERN METHOD:
BUILDER PATTERN
REFRENCES:
1.Online Library for Graduation Projects Management: The OGPL System
Lamia Ketari, King Saud University, Saudi Arabia, Jun 27, 2011 in Lisbon,
Portugal ISBN 978-1-880094-89-1 Publisher: Association for the Advancement
of Computing in Education (AACE), Waynesville, NC
2.Computer Simulation and Library Management
Linda Main Journal of Library Administration Volume 16, Number
4, 1992 ISSN 0193-0826
3.Moodle: Using Learning Communities to Create an Open Source Course
Management System
Martin Dougiamas, Peter Taylor, National Key Centre for Science and
Mathematics Education, Australia
4.Building a maturity model for college library knowledge management
system
Zhenzhong Yang ; Huanhai Bai
5.A novel approach for building open library student credit evaluation
system
Shao-hua Chen
6.Development of library management robotic system
Yogesh Angal ; Anita Gade
7.Programmatic assessment: turning process into practice by teaching for
learning
Author links open overlay panelDorothy AnneWarnera
Dorothy Anne Warner is Associate Professor-Librarian at Rider University
Libraries, Moore Library, 2083 Lawrenceville Road, Lawrenceville, New Jersey,
08648-3099, USA
8.Changes in faculty reading behaviors: the impact of electronic journals on
the University of Georgia
Author links open overlay panelErin TSmitha
Erin T. Smith is Librarian at McGill Library, Westminster College, 319 S. Market
Street, New Wilmington, PA, 16172 USA This research was conducted between
March 2001 and July 2002, at which time Erin Smith held the position of Science
Reference Librarian with the University of Georgia Libraries
9.Cultural diversity and undergraduates’ academic library use
Author links open overlay panelEtheleneWhitmirea
Ethelene Whitmire is Assistant Professor at the University of Wisconsin—
Madison, School of Library and Information Studies, Helen C. White Hall, 600
North Park Street, Madison, WI 53706, USA
10.iim digital library system: consortia-based approach
M Paul Pandian, Ashok Jambhekar, C R. Karisiddappa Electronic
Library Volume 20, Number 3, 2002 ISSN 0264-0473
11.vlfeat - An open and portable library of computer vision algorithms
Andrea Vedaldi Department of Engineering Science Oxford University
Oxford, UK vedaldi@robots.ox.ac.uk Brian Fulkerson Computer Science
Department University of California at Los Angeles Los Angeles, CA, USA
bfulkers@cs.ucla.edu

12.Automatic Book Placement and Searching Technique for Performance


Enhancement of Library Management System
Umar Farooq, Muhammad Amar, K. M. Hasan, Muhammad Usman Asad and
Asim Iqbal
13.impact on library management system(lms):impact on library
enviroments
‘Alwi Mohd Yunus,Irwan Kamaruddin Abd Kadir,Ahmad Nazri Mansor
14.an advanced library management system using android device
Sahana Karanth1 , *Jenishiya Castelino2, *Nireeksha3, *Frencita Nazareth4, *
Anvitha K5 Assistant Professor, Department of Computer Science, SMVITM,
Udupi, India 1 UG student, Department of Computer Science, SMVITM, Udupi,
India
15.intelligent library management system using gsm and rfid
S. Vijayagowri,Student, Department of electronics and communication
engineering, Hindusthan institute of technology, Coimbatore
Mrs. B. Kousalya., M.E., Head of the department, Department of electronics
and communication engineering Hindusthan institute of technology, Coimbatore
1sgowri993@gmail.com
16. Blue-Droid: An Intelligent Library Management System on Android
Platform
Subhadeep Bhattacharya1 1Department of Information Technology, St.
Thomas’ College of Engineering and Technology, Kolkata, India
17. Analysis and Design of the Database of Library Network Management
System
XueLian Feng, HaiYan Liu ,Baotou railway vocational technical
college,Baotou,Inner Mongolia, 014040,China
18.Radio Frequency Identification for Efficient Library Management
Khairul Azizan Suda,IPROM, Universiti Kuala Lumpur,Malaysia
Nazatul Shima Abdul Rani,School of Management, Asia e University,Kuala
Lumpur, Malaysia
19.iot-Based Library Automation and Monitoring system: Developing an
Implementation framework of Implementation
Majid Bayani Alberto Segura Marjorie Alvarado Mayra Loaiza
20.assesing the effectiveness of library instruction among the post graduate
students in bharathidasan university
Abu KS;Dr Balasubramani R ;January 2019
21.Information Literacy Skills among Library and Information Science
Professionals in India
Thanuskodi, S, "Dr·; January 2019
22.The Role of Librarians in the Implementation of the National Policy of
Education
Victoria O. Itsekor ;Jegbefume, Chukwudum Mareen, Miss;Oyewole,
Oluwatofunmi Jesudunni, Mrs; January 2019
DESIGN PATTERNS

M.TECH SOFTWARE ENGINEERING (INTERGRATED)

SCHOOL OF INFORMATION TECHNOLOGY


AND ENGINEERING
REVIEW 2
“LIBRARY MANAGEMENT SYSTEM”

SUBMITTED BY: -

• JAGADEESHWARAN.J (17MIS0400)
• AKASH VANAN.A (17MIS0255)
• SHATE BHARATH (17MS0452)
• MAGESH S.V (17MIS0280)

UNDER THE GUIDANCE OF: -

Dr. SENTHILKUMAR.M

School of information technology and engineering

VIT
BRIDGE PATTERN
Intent
• Decouple an abstraction from its implementation so that the two can vary
independently
Also known as
• Handle / Body
Motivation
In Library Management system implementing with the two modules of students
and librarians. Each of them are access and do their work in independently.
When an abstraction can have one of several possible implementations, the usual
way to accommodate them is to use inheritance
An abstract class defines the interface to the abstraction, and concrete subclasses
implement it in different ways.
This approach isn't always flexible enough: inheritance binds an implementation
to the abstraction permanently, which makes it difficult to modify, extend and
reuse abstractions and implementations independently.
Bridge pattern structure
Applicability
– You want to avoid permanent binding between an abstraction and
its implementation.
– Both the abstractions and their implementations should be
extensible by sub classing.
– Changes in the implementation of an abstraction should have no
impact on clients.
– (C++) you want to hide the implementation of and abstraction
completely from clients.
– You have a proliferation of classes. Need for splitting an object
into two parts.
– You want to share implementation among multiple objects, and
this fact should be hidden from the client.
Participants
• Abstraction
• Refined Abstraction
• Implementer
• Concrete Implementor
Collaborations
• Abstraction forwards clients requests to its Implementer object.
Consequences
• Decoupling interface and implementation
– Implementation is not bound permanently to an interface.
– The implementation of an abstraction can be configured at run-
time.
– Object can change its implementation at run-time.
– Eliminates compile-time dependencies on implementation.
• Hiding implementation details from clients
– You can shield clients from implementation details, like the
sharing of implementor objects and accompanying reference count
mechanism.
Implementation
• Only one Implementer
– In the situations where there’s only one implementation, creating
an abstract Implementer class isn’t necessary.
– but still useful when a change in the implementation of a class
must not affect its existing clients.
• Creating the right Implementer object.[ How, when, and where do you
decide which Implementer class to instantiate when there’s more than
one?]
– If Abstraction knows about all Concrete Implementor classes, then
it can instantiate one of them in its constructor; it can decide
between them based on parameters passes to its constructor.
– Choose a default implementation initially and change it later
according to usage.
– Delegate the decision to another object altogether.
Known uses
• Window example comes from ET++ .
Related patterns
• An Abstract Factory can create and configure a particular Bridge.
• The Adapter pattern is geared toward making unrelated classes work
together. It usually applied to systems after they’re designed. Bridge, on
the other hand, is used up-front in a design to let abstractions and
implementations vary independently.
CODE:
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<fstream>
#include<string.h>
#include<conio.h>
using namespace std;
class Lib
{
public:
char bookname[100],auname[50],sc[20],sc1[50];
int q,B,p;
Lib()
{
strcpy(bookname,"NO Book Name");
strcpy(auname,"No Author Name");
strcpy(sc,"No Book ID");
strcpy(sc1,"No Book ID");
q=0;
B=0;
p=0;
}
void get();
void student();
void pass();
void librarian();
void password();
void getdata();
void show(int);
void booklist(int);
void modify();
void see(int);
int branch(int);
void issue();
void der(char[],int,int);
void fine(int,int,int,int,int,int);
};
void Lib::getdata()
{
int i;
fflush(stdin);
cout<<"\n\t\tEnter the details :-\n";
cout<<"\n\t\tEnter Book's Name : ";
cin.getline(bookname,100);
for(i=0;bookname[i]!='\0';i++)
{
if(bookname[i]>='a'&&bookname[i]<='z')
bookname[i]-=32;
}
cout<<"\n\t\tEnter Author's Name : ";
cin.getline(auname,50);
cout<<"\n\t\tEnter Publication name : ";
cin.getline(sc1,50);
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(sc,20);
cout<<"\n\t\tEnter Book's Price : ";
cin>>p;
cout<<"\n\t\tEnter Book's Quantity : ";
cin>>q;
}
void Lib::show(int i)
{
cout<<"\n\t\tBook Name : "<<bookname<<endl;
cout<<"\n\t\tBook's Author Name : "<<auname<<endl;
cout<<"\n\t\tBook's ID : "<<sc<<endl;
cout<<"\n\t\tBook's Publication : "<<sc1<<endl;
if(i==2)
{
cout<<"\n\t\tBook's Price : "<<p<<endl;
cout<<"\n\t\tBook's Quantity : "<<q<<endl;
}
}
void Lib::booklist(int i)
{
int b,r=0;
system("cls");
b=branch(i);
system("cls");
ifstream intf("Booksdata.txt",ios::binary);
if(!intf)
cout<<"\n\t\tFile Not Found.";
else
{
cout<<"\n\t ************ Book List ************ \n\n";
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
if(b==B)
{
if(q==0 && i==1)
{

}
else
{
r++;
cout<<"\n\t\t********** "<<r<<". ********** \n";
show(i);
}
}
intf.read((char*)this,sizeof(*this));
}
}
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
if(i==1)
student();
else
librarian();
}
void Lib::modify()
{
char ch,st1[100];
int i=0,b,cont=0;
system("cls");
cout<<"\n\t\t>>Please Choose one option :-\n";
cout<<"\n\t\t1.Modification In Current Books\n\n\t\t2.Add New Book\n\n\t\t3.Delete A
Book\n\n\t\t4.Go back\n";
cout<<"\n\n\t\tEnter your choice : ";
cin>>i;
if(i==1)
{
system("cls");
b=branch(2);
ifstream intf1("Booksdata.txt",ios::binary);
if(!intf1)
{
cout<<"\n\t\tFile Not Found\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
librarian();
}
intf1.close();
system("cls");
cout<<"\n\t\tPlease Choose One Option :-\n";
cout<<"\n\t\t1.Search By Book Name\n\n\t\t2.Search By Book's ID\n";
cout<<"\n\t\tEnter Your Choice : ";
cin>>i;
fflush(stdin);
if(i==1)
{
system("cls");
cout<<"\n\t\tEnter Book Name : ";
cin.getline(st1,100);
system("cls");
fstream intf("Booksdata.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{

for(i=0;b==B&&bookname[i]!='\0'&&st1[i]!='\0'&&(st1[i]==bookname[i]||st1[i]==bookname[i]+32);i
++);
if(bookname[i]=='\0'&&st1[i]=='\0')
{
cont++;
getdata();
intf.seekp(intf.tellp()-sizeof(*this));
intf.write((char*)this,sizeof(*this));
break;
}
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else if(i==2)
{
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,100);
system("cls");
fstream intf("Booksdata.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;b==B&&sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[i];i++);
if(sc[i]=='\0'&&st1[i]=='\0')
{
cont++;
getdata();
intf.seekp(intf.tellp()-sizeof(*this));
intf.write((char*)this,sizeof(*this));
break;
}
intf.read((char*)this,sizeof(*this));
}

intf.close();
}
else
{
cout<<"\n\t\tIncorrect Input.....:(\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
modify();
}
if(cont==0)
{
cout<<"\n\t\tBook Not Found.\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
modify();
}
else
cout<<"\n\t\tUpdate Successful.\n";

}
else if(i==2)
{
system("cls");
B=branch(2);
system("cls");
getdata();
ofstream outf("Booksdata.txt",ios::app|ios::binary);
outf.write((char*)this,sizeof(*this));
outf.close();
cout<<"\n\t\tBook added Successfully.\n";
}
else if(i==3)
{
system("cls");
b=branch(2);
ifstream intf1("Booksdata.txt",ios::binary);
if(!intf1)
{
cout<<"\n\t\tFile Not Found\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
intf1.close();
system("cls");
librarian();
}
intf1.close();
system("cls");
cout<<"\n\t\tPlease Choose One Option for deletion:-\n";
cout<<"\n\t\t1.By Book Name\n\n\t\t2.By Book's ID\n";
cout<<"\n\t\tEnter Your Choice : ";
cin>>i;
fflush(stdin);
if(i==1)
{
system("cls");
cout<<"\n\t\tEnter Book Name : ";
cin.getline(st1,100);
ofstream outf("temp.txt",ios::app|ios::binary);
ifstream intf("Booksdata.txt",ios::binary);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{

for(i=0;b==B&&bookname[i]!='\0'&&st1[i]!='\0'&&(st1[i]==bookname[i]||st1[i]==bookname[i]+32);i
++);
if(bookname[i]=='\0'&&st1[i]=='\0')
{
cont++;
intf.read((char*)this,sizeof(*this));
}
else
{
outf.write((char*)this,sizeof(*this));
intf.read((char*)this,sizeof(*this));
}
}

intf.close();
outf.close();
remove("Booksdata.txt");
rename("temp.txt","Booksdata.txt");
}
else if(i==2)
{
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,100);
ofstream outf("temp.txt",ios::app|ios::binary);
ifstream intf("Booksdata.txt",ios::binary);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;b==B&&sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[i];i++);
if(sc[i]=='\0'&&st1[i]=='\0')
{
cont++;
intf.read((char*)this,sizeof(*this));
}
else
{
outf.write((char*)this,sizeof(*this));
intf.read((char*)this,sizeof(*this));
}
}
outf.close();
intf.close();
remove("Booksdata.txt");
rename("temp.txt","Booksdata.txt");
}
else
{
cout<<"\n\t\tIncorrect Input.....:(\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
modify();
}
if(cont==0)
{
cout<<"\n\t\tBook Not Found.\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
modify();
}
else
cout<<"\n\t\tDeletion Successful.\n";

}
else if(i==4)
{
system("cls");
librarian();
}
else
{
cout<<"\n\t\tWrong Input.\n";
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
modify();
}
cout<<"\n\t\tPress any key to continue.....";
getch();
system("cls");
librarian();

}
int Lib::branch(int x)
{
int i;
cout<<"\n\t\t>>Please Choose one Branch :-\n";
cout<<"\n\t\t1.BIT\n\n\t\t2.EE\n\n\t\t3.EC\n\n\t\t4.CIVIL\n\n\t\t5.MECHANICAL\n\n\t\t6.1ST
YEAR\n\n\t\t7.Go to menu\n";
cout<<"\n\t\tEnter youur choice : ";
cin>>i;
switch(i)
{
case 1: return 1;
break;
case 2: return 2;
break;
case 3: return 3;
break;
case 4: return 4;
break;
case 5: return 5;
break;
case 6: return 6;
break;
case 7: system("cls");
if(x==1)
student();
else
librarian();
default : cout<<"\n\t\tPlease enter correct option :(";
getch();
system("cls");
branch(x);
}
}
void Lib::see(int x)
{
int i,b,cont=0;
char ch[100];
system("cls");
b=branch(x);
ifstream intf("Booksdata.txt",ios::binary);
if(!intf)
{
cout<<"\n\t\tFile Not Found.\n";
cout<<"\n\t\t->Press any key to continue.....";
getch();
system("cls");
if(x==1)
student();
else
librarian();
}

system("cls");
cout<<"\n\t\tPlease Choose one option :-\n";
cout<<"\n\t\t1.Search By Name\n\n\t\t2.Search By Book's ID\n";
cout<<"\n\t\tEnter Your Choice : ";
cin>>i;
fflush(stdin);
intf.read((char*)this,sizeof(*this));
if(i==1)
{
cout<<"\n\t\tEnter Book's Name : ";
cin.getline(ch,100);
system("cls");
while(!intf.eof())
{

for(i=0;b==B&&q!=0&&bookname[i]!='\0'&&ch[i]!='\0'&&(ch[i]==bookname[i]||ch[i]==bookname[i]
+32);i++);
if(bookname[i]=='\0'&&ch[i]=='\0')
{
cout<<"\n\t\tBook Found :-\n";
show(x);
cont++;
break;
}
intf.read((char*)this,sizeof(*this));
}
}
else if(i==2)
{
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(ch,100);
system("cls");
while(!intf.eof())
{
for(i=0;b==B&&q!=0&&sc[i]!='\0'&&ch[i]!='\0'&&ch[i]==sc[i];i++);
if(sc[i]=='\0'&&ch[i]=='\0')
{
cout<<"\n\t\tBook Found :-\n";
show(x);
cont++;
break;
}
intf.read((char*)this,sizeof(*this));
}

}
else
{
cont++;
cout<<"\n\t\tPlease enter correct option :(";
getch();
system("cls");
see(x);
}
intf.close();
if(cont==0)
cout<<"\n\t\tThis Book is not available :( \n";

cout<<"\n\t\tPress any key to continue.....";


getch();
system("cls");
if(x==1)
student();
else
librarian();

}
void Lib::issue()
{
char st[50],st1[20];
int b,i,j,d,m,y,dd,mm,yy,cont=0;
system("cls");
cout<<"\n\t\t->Please Choose one option :-\n";
cout<<"\n\t\t1.Issue Book\n\n\t\t2.View Issued Book\n\n\t\t3.Search student who isuued
books\n\n\t\t4.Reissue Book\n\n\t\t5.Return Book\n\n\t\t6.Go back to menu\n\n\t\tEnter Your
Choice : ";
cin>>i;
fflush(stdin);
if(i==1)
{
system("cls");
b=branch(2);
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details :-\n";
cout<<"\n\t\tEnter Book Name : ";
cin.getline(bookname,100);
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(sc,20);
//strcpy(st,sc);
der(sc,b,1);
cout<<"\n\t\tEnter Student Name : ";
cin.getline(auname,100);
cout<<"\n\t\tEnter Student's ID : ";
cin.getline(sc1,20);
cout<<"\n\t\tEnter date : ";
cin>>q>>B>>p;
ofstream outf("student.txt",ios::binary|ios::app);
outf.write((char*)this,sizeof(*this));
outf.close();
cout<<"\n\n\t\tIssue Successfully.\n";
}
else if(i==2)
{
ifstream intf("student.txt",ios::binary);
system("cls");
cout<<"\n\t\t->The Details are :-\n";
intf.read((char*)this,sizeof(*this));
i=0;
while(!intf.eof())
{
i++;
cout<<"\n\t\t********** "<<i<<". ********** \n";
cout<<"\n\t\tStudent Name : "<<auname<<"\n\t\t"<<"Student's ID : "<<sc1<<"\n\t\t"<<"Book
Name : "<<bookname<<"\n\t\t"<<"Book's ID : "<<sc<<"\n\t\t"<<"Date :
"<<q<<"/"<<B<<"/"<<p<<"\n";
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else if(i==3)
{
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details :-\n";
cout<<"\n\n\t\tEnter Student Name : ";
cin.getline(st,50);
cout<<"\n\n\t\tEnter Student's ID : ";
cin.getline(st1,20);
system("cls");
ifstream intf("student.txt",ios::binary);
intf.read((char*)this,sizeof(*this));
cont=0;
while(!intf.eof())
{
for(i=0;sc1[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc1[i];i++);
if(sc1[i]=='\0'&&st1[i]=='\0')
{
cont++;
if(cont==1)
{
cout<<"\n\t\t->The Details are :-\n";
cout<<"\n\t\tStudent Name : "<<auname;
cout<<"\n\t\tStudent's ID : "<<sc1;
}
cout<<"\n\n\t\t******* "<<cont<<". Book details *******\n";
cout<<"\n\t\tBook Name : "<<bookname;
cout<<"\n\t\tBook's ID : "<<sc;
cout<<"\n\t\tDate : "<<q<<"/"<<B<<"/"<<p<<"\n";
}
intf.read((char*)this,sizeof(*this));

}
intf.close();
if(cont==0)
cout<<"\n\t\tNo record found.";
}
else if(i==4)
{
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details :-\n";
cout<<"\n\n\t\tEnter Student's ID : ";
cin.getline(st,50);
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,20);
fstream intf("student.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[i];i++);
for(j=0;sc1[j]!='\0'&&st[j]!='\0'&&st[j]==sc1[j];j++);
if(sc[i]=='\0'&&sc1[j]=='\0'&&st[j]=='\0'&&st1[i]=='\0')
{
d=q;
m=B;
y=p;
cout<<"\n\t\tEnter New Date : ";
cin>>q>>B>>p;
fine(d,m,y,q,B,p); //fn1
intf.seekp(intf.tellp()-sizeof(*this)); //fn3
intf.write((char*)this,sizeof(*this)); //fn5
cout<<"\n\n\t\tReissue successfully."; //fn3
break;
}
intf.read((char*)this,sizeof(*this));
}
intf.close();
}
else if(i==5)
{
system("cls");
b=branch(2);
system("cls");
fflush(stdin);
cout<<"\n\t\t->Please Enter Details :-\n";
cout<<"\n\t\tEnter Book's ID : ";
cin.getline(st1,20);
der(st1,b,2);
cout<<"\n\n\t\tEnter Student's ID : ";
cin.getline(st,20);
cout<<"\n\t\tEnter Present date : ";
cin>>d>>m>>y;
ofstream outf("temp.txt",ios::app|ios::binary);
ifstream intf("student.txt",ios::binary);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;sc[i]!='\0'&&st1[i]!='\0'&&st1[i]==sc[i];i++);
for(j=0;sc1[j]!='\0'&&st[j]!='\0'&&st[j]==sc1[j];j++);
if(sc[i]=='\0'&&sc1[j]=='\0'&&st[j]=='\0'&&st1[i]=='\0'&&cont==0)
{
cont++;
intf.read((char*)this,sizeof(*this));
fine(q,B,p,d,m,y);
cout<<"\n\t\tReturned successfully.";
}
else
{
outf.write((char*)this,sizeof(*this));
intf.read((char*)this,sizeof(*this));
}
}
intf.close();
outf.close();
getch();
remove("student.txt");
rename("temp.txt","student.txt");
}
else if(i==6)
{
system("cls");
librarian();
}
else
cout<<"\n\t\tWrong Input.\n";

cout<<"\n\n\t\tPress any key to continue.....";


getch();
system("cls");
librarian();
}
void Lib::fine(int d,int m,int y,int dd,int mm,int yy)
{
long int n1,n2;
int years,l,i;
const int monthDays[12] = {31, 28, 31, 30, 31, 30,31, 31, 30, 31, 30, 31};
n1 = y*365 + d;
for (i=0; i<m - 1; i++)
n1 += monthDays[i]; //fn1353
years = y;
if (m <= 2)
years--;
l= years / 4 - years / 100 + years / 400;
n1 += l;
n2 = yy*365 + dd;
for (i=0; i<mm - 1; i++)
n2 += monthDays[i];
years = yy;
if (m <= 2)
years--;
l= years / 4 - years / 100 + years / 400;
n2 += l;
n1=n2-n1;
n2=n1-15;
if(n2>0)
cout<<"\n\t\tThe Total Fine is : "<<n2;

}
void Lib::der(char st[],int b,int x)
{
int i,cont=0;
fstream intf("Booksdata.txt",ios::in|ios::out|ios::ate|ios::binary);
intf.seekg(0);
intf.read((char*)this,sizeof(*this));
while(!intf.eof())
{
for(i=0;b==B&&sc[i]!='\0'&&st[i]!='\0'&&st[i]==sc[i];i++);
if(sc[i]=='\0'&&st[i]=='\0')
{
cont++;
if(x==1)
{
q--;
}
else
{
q++;
}
intf.seekp(intf.tellp()-sizeof(*this));
intf.write((char*)this,sizeof(*this));
break;
}
intf.read((char*)this,sizeof(*this));
}
if(cont==0)
{
cout<<"\n\t\tBook not found.\n";
cout<<"\n\n\t\tPress any key to continue.....";
getch();
system("cls");
issue();
}
intf.close();
}
void Lib::get()
{
int i;
cout<<"\n\t*********** LIBRARY MANAGEMENT SYSTEM ***********\n"<<"\n\t\t\t LMS
C++\n";
cout<<"\n\t\t>>Please Choose Any Option To login \n";
cout<<"\n\t\t1.Student\n\n\t\t2.Librarian\n\n\t\t3.Close Application\n";
cout<<"\n\t\tEnter your choice : ";
cin>>i;
if(i==1)
{
system("cls");
student();
}
else if(i==2)
pass();

else if(i==3)
exit(0);
else
{
cout<<"\n\t\tPlease enter correct option :(";
getch();
system("CLS");
get();
}
}
void Lib::student()
{
int i;
cout<<"\n\t************ WELCOME STUDENT ************\n";
cout<<"\n\t\t>>Please Choose One Option:\n";
cout<<"\n\t\t1.View BookList\n\n\t\t2.Search for a Book\n\n\t\t3.Go to main
menu\n\n\t\t4.Close Application\n";
cout<<"\n\t\tEnter your choice : ";
cin>>i;
if(i==1)
booklist(1);
else if(i==2)
see(1);
else if(i==3)
{
system("cls");
get();
}
else if(i==4)
exit(0);
else
{
cout<<"\n\t\tPlease enter correct option :(";
getch();
system("cls");
student();
}
}
void Lib::pass()
{
int i=0;
char ch,st[21],ch1[21]={"pass"};
cout<<"\n\t\tEnter Password : ";
while(1)
{
ch=getch();
if(ch==13)
{
st[i]='\0';
break;
}
else if(ch==8&&i>0)
{
i--;
cout<<"\b \b";
}
else
{
cout<<"*";
st[i]=ch;
i++;
}
}
ifstream inf("password.txt");
inf>>ch1;
inf.close();
for(i=0;st[i]==ch1[i]&&st[i]!='\0'&&ch1[i]!='\0';i++);
if(st[i]=='\0'&&ch1[i]=='\0')
{
system("cls");
librarian();
}
else
{
cout<<"\n\n\t\tWrong Password.\n\n\t\ttry again.....\n";
getch();
system("cls");
get();
}
}
void Lib::librarian()
{
int i;
cout<<"\n\t************ WELCOME LIBRARIAN ************\n";
cout<<"\n\t\t>>Please Choose One Option:\n";
cout<<"\n\t\t1.View BookList\n\n\t\t2.Search for a Book\n\n\t\t3.Modify/Add
Book\n\n\t\t4.Issue Book\n\n\t\t5.Go to main menu\n\n\t\t6.Change Password\n\n\t\t7.Close
Application\n";
cout<<"\n\t\tEnter your choice : ";
cin>>i;
switch(i)
{
case 1:booklist(2);
break;
case 2:see(2);
break;
case 3:modify();
break;
case 4:issue();
break;
case 5:system("cls");
get();
break;
case 6:password();
break;
case 7:exit(0);
default:cout<<"\n\t\tPlease enter correct option :(";
getch();
system("cls");
librarian();
}
}
void Lib::password()
{
int i=0,j=0;
char ch,st[21],ch1[21]={"pass"};
system("cls");
cout<<"\n\n\t\tEnter Old Password : ";
while(1)
{
ch=getch();
if(ch==13)
{
st[i]='\0';
break;
}
else if(ch==8&&i>0)
{
i--;
cout<<"\b \b";
}
else
{
cout<<"*";
st[i]=ch;
i++;
}
}
ifstream intf("password.txt");
intf>>ch1;
intf.close();
for(i=0;st[i]==ch1[i]&&st[i]!='\0'&&ch1[i]!='\0';i++);
if(st[i]=='\0'&&ch1[i]=='\0')
{
system("cls");
cout<<"\n\t**The Password Should be less than 20 characters & don't use spaces**\n\n";
cout<<"\n\t\tEnter New Password : ";
fflush(stdin);
i=0;
while(1)
{
j++;
ch=getch();
if(ch==13)
{
for(i=0;st[i]!=' '&&st[i]!='\0';i++);
if(j>20 || st[i]==' ')
{
cout<<"\n\n\t\tYou did't follow the instruction \n\n\t\tPress any key for try again.....";
getch();
system("cls");
password();
librarian();
}
st[i]='\0';
break;
}
else if(ch==8&&i>0)
{
i--;
cout<<"\b \b";
}
else
{
cout<<"*";
st[i]=ch;
i++;
}
}
ofstream outf("password.txt");
outf<<st;
outf.close();
cout<<"\n\n\t\tYour Password has been changed Successfully.";
cout<<"\n\t\tPress any key to continue......";
getch();
system("cls");
librarian();
}
else
{
cout<<"\n\n\t\tPassword is incorrect.....\n";
cout<<"\n\t\tEnter 1 for retry or 2 for menu";
cin>>i;
if(i==1)
{
system("cls");
password();
}
else
{
system("cls");
librarian();
}
}
}
int main()
{
Lib obj;
obj.get();
getch();
return 0;
}
IMPLEMENTATION:
Main menu

Student
Book for suitable Branch

Librarian
Options for librarian access

Change password
Old password
New password

Potrebbero piacerti anche