Ajp 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Matoshri Education Society’s

MATOSHRI INSTITUTE OF TECHNOLOGY


A/P : Dhanore, Tal-Yeola , Dist.-Nasik, 423401

Micro Project Report


Academic year: 2024-25

Title of Project
Library Management System

Name of Student: Raundal Yash Suresh


Class : TYCO
Semester : Fifth
Roll No : 08
Enrollment No: 2211710048
Seat No :

Program : Computer Engineering


Course : AJP
Course code : 22517
Name of Teacher: Miss. Khan M. K.
Matoshri Education Society’s
MATOSHRI INSTITUTE OF TECHNOLOGY
A/P : Dhanore, Tal-Yeola , Dist.-Nasik, 423401

CERTIFICATE
This is to certify that Mr. Raundal Yash Suresh
Roll no 08 Of Fifth Semester of Diploma in
Computer Engineering has successfully completed
the for the Academic yeear 2024 -2025 as prescribed
MSBTE Micro Project in Library Management
System curriculum under the guidance of subject
teacher.

Place: Yeola Enrollment No: 2211710048


Date: Seat No:

Subject Teacher HOD Principal


Miss. Khan M.K. Mr. Ghorpde M. S. Mr. Gujrathi G.S.
Micro Project Report Index

Academic Year: 2024-25 Program: Computer Engineering


Class: TYCO Course: AJP
Course Code: 22517 Roll No: 08
Enrollment No: 2211710048 Exam Seat No:

Title of Micro Project: - Library Management System

Sr. Contents Page No.


No.
1 Introduction 16

2 Project Requirements 17

3 System Design 19

4 Implementation 20

5 Source Code

6 Functionality 21

7 Output

8 Conclusion

9 Reference

Signature of Students Signature of Faculty


Raundal Yash Suresh Miss. Khan M. K.

ANNEXURE I
Rubric for Evaluation of Micro Project

Academic Year: 2024-25 Program: Computer Engineering


Class: TYCO Course: AJP
Course Code: Roll No: 08
Enrollment No: 2211710048 Exam Seat No:

Title of Micro Project: - Library Management System


Group Members:
Sr.No. Roll No. Name of Candidates

1 08 Raundal Yash Suresh

CO coverage:

Indicators for different level of Performance


Marks
(Evaluation Scale 0 to 2)
Sr. No Criteria Obtained (
Out of 2) Poor (0) Average (1) Good (2)

Submission of Not Submitted proposal or project Project proposal &


1 Project anything in report submitted in project report
proposal/Report time time submitted ij time
CO/PRO Not attained any Attained some Attained
2 Attainment CO/PRO CO/PRO Maximum
Contains
Content of Not contains
Contains some relevant maximum
3 project/Formatti relevant
information relevant
ng information information
Total Marks
4 (06)
QuAJPion/
5 Answers (04)
Total (10) :

Additional Comments (if any):

Name of Teacher & Sign


Miss. Khan M. K.
Micro Project Proposal

Academic Year: 2024-25 Program: Computer Engg


Class: TYCO Course: AJP
Course Code: 22517

Title of Micro Project: Library Management System

Group Members:
Sr no Roll no Name Of Candidates

1 08 Raundal Yash Suresh

Content / Key Points:


Understanding concets of organization

Stationary/ Material Required (if any):

Internet Source

References:
https://www.geeksforgeeks.org/network-protocols-and-proxies-in-system-design/
Micro Project Log Book

SemAJPer: Fifth Program: Computer Engineering


Course: AJP Class: TYCO

Topic of the Micro-Project :- Library Management System

Sr.No. Roll No. Name of Group Members Sign


1 08 Raundal Yash Suresh

Week Discussion & Details Teacher’s Teacher’s


No. Comment Sign
1 General Discussion about micro project activity.
2 Guidelines for micro project
3 Discussion on different industry/application/study
oriented topics
4 Group member are finalized and the topic is
decided, as
5 Work distribution to collect the information regarding
topic by each member.
6 Gathered information through the various sources, such
as internet, book, magazine, joutrnar and newspaper
7 Discussed the difficulty faced during the collection of
necessary information among the group member.
8 Discussion with the guide to sort out differently faced
while collecting the information.
9 Prepared a rough draft & shown it to the guide.

10 Necessary instructions are given by the guide for its


better Presentation & Finalized project.
11 Presentation is given on the topic, Report is prepared onthe
topics & final submission of micro project and
Report

Name & Signature of project Guide Name & Signature of HOD


Mr.Ghorpade .M.S
Introduction
In an increasingly digital world, the management of library resources
has become more critical than ever. Libraries serve as vital institutions
for knowledge acquisition, providing access to a wealth of information
in various formats. However, the traditional methods of managing these
resources can often lead to inefficiencies and challenges in tracking
inventory, issuing books, and maintaining user records. To address
these issues, we have developed a Library Management System (LMS)
that streamlines the process of managing books and users, enhancing
the overall efficiency and user experience within a library environment.
The primary objective of this project is to create a user-friendly and
efficient system that simplifies the management of library operations.
This system allows librarians to perform essential tasks such as adding
new books, registering users, issuing books to users, and handling the
return of books. By automating these functions, the LMS minimizes the
potential for errors associated with manual record-keeping, ensuring
accurate tracking of book availability and user history. Additionally, the
system provides an intuitive graphical user interface (GUI) that
facilitates easy interaction for both librarians and users.
This report outlines the development process of the Library
Management System, detailing the requirements, design,
implementation, and testing phases. Through this project, we aim to
showcase how technology can be effectively integrated into traditional
library management practices, resulting in improved organization,
reduced workload, and enhanced service delivery for library patrons.
Ultimately, this system not only fulfills the immediate needs of library
management but also lays the groundwork for potential future
enhancements and scalability.
Project Requirements
✓ List the functional requirements, such as adding and issuing
books, and non-functional requirements, such as performance and
usability.
✓ Specify tools and technologies (Java, Swing, etc.) used in the
project.

System Design
✓ Include a high-level architectural diagram showing how the
classes interact.
✓ Provide a class diagram detailing the relationships between Book,
User, and LibraryManagementSystemGUI.

Implementation
✓ Describe how to set up the development environment (JDK
installation, IDE setup).
✓ Explain the code in each class, detailing methods and their
purposes.
✓ Discuss the GUI design, including layout decisions and
component choices.
Source code
# Book.java
public class Book {
private String title;
private String author;
private boolean isIssued; public Book(String title, String author) {
this.title = title;
this.author = author;
this.isIssued = false;
} public String getTitle() {
return title;
} public String getAuthor() {
return author;
} public boolean isIssued() {
return isIssued;
} public void setIssued(boolean issued) {
isIssued = issued;
}
@Override
public String toString() {
return "Title: " + title + ", Author: " + author + ", Issued: " +
(isIssued ? "Yes" : "No");
}
}
# User.java
import java.util.ArrayList;
public class User {
private String name;
private ArrayList<Book> issuedBooks;

public User(String name) {


this.name = name;
this.issuedBooks = new ArrayList<>();
}
public String getName() {
return name;
}

public ArrayList<Book> getIssuedBooks() {


return issuedBooks;
}

@Override
public String toString() {
return "User: " + name + ", Issued Books: " + issuedBooks.size();
}
}
# LibraryManagementSystemGUI.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;

public class LibraryManagementSystemGUI extends JFrame {


private ArrayList<Book> books;
private ArrayList<User> users;

private JTextField bookTitleField;


private JTextField bookAuthorField;
private JTextField userField;

public LibraryManagementSystemGUI() {
books = new ArrayList<>();
users = new ArrayList<>();

// Setting up the JFrame


setTitle("Library Management System");
setSize(600, 500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// Create the UI components with custom font and alignment


Font font = new Font("Arial", Font.PLAIN, 24); // Font size 24
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(10, 10, 10, 10); // Padding for
components
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.gridx = 0;
gbc.gridy = 0;

// Set up labels and fields


JLabel bookTitleLabel = new JLabel("Book Title:");
bookTitleLabel.setFont(font); // Set font size to 24
panel.add(bookTitleLabel, gbc);

gbc.gridx = 1;
bookTitleField = new JTextField(15);
bookTitleField.setFont(font); // Set font size to 24
panel.add(bookTitleField, gbc);

gbc.gridx = 0;
gbc.gridy = 1;
JLabel bookAuthorLabel = new JLabel("Book Author:");
bookAuthorLabel.setFont(font); // Set font size to 24
panel.add(bookAuthorLabel, gbc);
gbc.gridx = 1;
bookAuthorField = new JTextField(15);
bookAuthorField.setFont(font); // Set font size to 24
panel.add(bookAuthorField, gbc);

gbc.gridx = 0;
gbc.gridy = 2;
JLabel userLabel = new JLabel("User Name:");
userLabel.setFont(font); // Set font size to 24
panel.add(userLabel, gbc);

gbc.gridx = 1;
userField = new JTextField(15);
userField.setFont(font); // Set font size to 24
panel.add(userField, gbc);

// Add buttons with smaller size


gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 2;

JPanel buttonPanel = new JPanel();


buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER,
10, 10)); // Center buttons

JButton addBookButton = new JButton("Add Book");


JButton viewBooksButton = new JButton("View Books");
JButton issueBookButton = new JButton("Issue Book");
JButton returnBookButton = new JButton("Return Book");
JButton searchBookButton = new JButton("Search Book");
JButton addUserButton = new JButton("Add User"); // New
button for adding users

// Set button font and size


addBookButton.setFont(font);
viewBooksButton.setFont(font);
issueBookButton.setFont(font);
returnBookButton.setFont(font);
searchBookButton.setFont(font);
addUserButton.setFont(font); // Set font for add user button

// Set button preferred size (decreased size)


Dimension buttonSize = new Dimension(200, 50); // Width,
Height
addBookButton.setPreferredSize(buttonSize);
viewBooksButton.setPreferredSize(buttonSize);
issueBookButton.setPreferredSize(buttonSize);
returnBookButton.setPreferredSize(buttonSize);
searchBookButton.setPreferredSize(buttonSize);
addUserButton.setPreferredSize(buttonSize); // Set size for add
user button

// Add buttons to the panel


buttonPanel.add(addBookButton);
buttonPanel.add(viewBooksButton);
buttonPanel.add(issueBookButton);
buttonPanel.add(returnBookButton);
buttonPanel.add(searchBookButton);
buttonPanel.add(addUserButton); // Add to panel

gbc.gridy = 4;
panel.add(buttonPanel, gbc);

// Add the panel to the JFrame


add(panel);

// Add action listeners for buttons


addBookButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
addBook();
}
});

viewBooksButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
viewBooks();
}
});

issueBookButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
issueBook();
}
});

returnBookButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
returnBook();
}
});

searchBookButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
searchBook();
}
});

// Action listener for the Add User button


addUserButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
addUser();
}
});

// Set JFrame to visible


setVisible(true);
}

// Add a new book to the collection


private void addBook() {
String title = bookTitleField.getText().trim();
String author = bookAuthorField.getText().trim();

if (title.isEmpty() || author.isEmpty()) {
JOptionPane.showMessageDialog(this, "Error: Both title and
author are required!", "Input Error",
JOptionPane.ERROR_MESSAGE);
return;
}

books.add(new Book(title, author));


JOptionPane.showMessageDialog(this, "Book added: " + title + "
by " + author, "Book Added",
JOptionPane.INFORMATION_MESSAGE);
}

// View all books in the collection


private void viewBooks() {
if (books.isEmpty()) {
JOptionPane.showMessageDialog(this, "No books available.",
"View Books", JOptionPane.INFORMATION_MESSAGE);
} else {
StringBuilder sb = new StringBuilder();
for (Book book : books) {
sb.append(book).append("\n");
}
JOptionPane.showMessageDialog(this, sb.toString(), "View
Books", JOptionPane.INFORMATION_MESSAGE);
}
}
// Issue a book to a user
private void issueBook() {
String title = bookTitleField.getText().trim();
String userName = userField.getText().trim();

if (title.isEmpty() || userName.isEmpty()) {
JOptionPane.showMessageDialog(this, "Error: Both book title
and user name are required!", "Input Error",
JOptionPane.ERROR_MESSAGE);
return;
}

User user = findUser(userName);


if (user == null) {
JOptionPane.showMessageDialog(this, "User not found.
Please add the user first.", "Issue Book",
JOptionPane.ERROR_MESSAGE);
return;
}

Book book = findBookByTitle(title);


if (book != null && !book.isIssued()) {
book.setIssued(true);
user.getIssuedBooks().add(book);
JOptionPane.showMessageDialog(this, "Book issued: " + title
+ " to " + userName, "Book Issued",
JOptionPane.INFORMATION_MESSAGE);
} else if (book == null) {
JOptionPane.showMessageDialog(this, "Book not found.",
"Issue Book", JOptionPane.ERROR_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, "Book is already
issued.", "Issue Book", JOptionPane.ERROR_MESSAGE);
}
}

// Return a book
private void returnBook() {
String title = bookTitleField.getText().trim();
String userName = userField.getText().trim();

if (title.isEmpty() || userName.isEmpty()) {
JOptionPane.showMessageDialog(this, "Error: Both book title
and user name are required!", "Input Error",
JOptionPane.ERROR_MESSAGE);
return;
}

User user = findUser(userName);


Book book = findBookByTitle(title);
if (user != null && book != null && book.isIssued() &&
user.getIssuedBooks().contains(book)) {
book.setIssued(false);
user.getIssuedBooks().remove(book);
JOptionPane.showMessageDialog(this, "Book returned: " +
title + " by " + userName, "Book Returned",
JOptionPane.INFORMATION_MESSAGE);
} else if (book == null) {
JOptionPane.showMessageDialog(this, "Book not found.",
"Return Book", JOptionPane.ERROR_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, "Book was not issued
to this user.", "Return Book", JOptionPane.ERROR_MESSAGE);
}
}

// Search for a book by title


private void searchBook() {
String title = bookTitleField.getText().trim();
Book book = findBookByTitle(title);
if (book != null) {
JOptionPane.showMessageDialog(this, book.toString(), "Book
Found", JOptionPane.INFORMATION_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, "Book not found.",
"Search Book", JOptionPane.ERROR_MESSAGE);
}
}

// Add a new user to the system


private void addUser() {
String userName = userField.getText().trim();

if (userName.isEmpty()) {
JOptionPane.showMessageDialog(this, "Error: User name is
required!", "Input Error", JOptionPane.ERROR_MESSAGE);
return;
}

User existingUser = findUser(userName);


if (existingUser != null) {
JOptionPane.showMessageDialog(this, "User already exists.",
"Add User", JOptionPane.ERROR_MESSAGE);
return;
}

users.add(new User(userName));
JOptionPane.showMessageDialog(this, "User added: " +
userName, "User Added",
JOptionPane.INFORMATION_MESSAGE);
}
// Find a book by title
private Book findBookByTitle(String title) {
for (Book book : books) {
if (book.getTitle().equalsIgnoreCase(title)) {
return book;
}
}
return null;
}
// Find a user by name
private User findUser(String userName) {
for (User user : users) {
if (user.getName().equalsIgnoreCase(userName)) {
return user;
}
}
return null;
}

public static void main(String[] args) {


new LibraryManagementSystemGUI();
}
}
Output
Functionality
1. Adding Books:
Allows librarians to input book titles and authors, checking for
duplicates before adding them to the inventory.
2. User Registration:
Enables users to register by entering their names, with checks to
prevent duplicate registrations.
3. Issuing Books:
Users can borrow books by entering their username and the
book title, provided both the user and book are valid.
4. Returning Books:
Users can return borrowed books, updating the book's status to
available if it was issued to them.
5. Searching for Books:
Users can search for books by title, with the system returning
relevant details or notifying if not found.
6. Viewing All Books:
Provides a complete list of all books in the library, displaying
key information like title, author, and availability.
Conclusion
The Library Management System project effectively demonstrates the
integration of software engineering principles to create an efficient tool
for managing library resources. By automating essential functions such
as adding and issuing books, registering users, and processing returns,
the system enhances operational efficiency and improves user
experience through an intuitive graphical user interface. This project
highlights the significance of automation in reducing manual workloads
and minimizing errors, while also allowing for future scalability and
enhancements, such as online reservations and database integration.
Ultimately, this system serves as a solid foundation for modernizing
library management practices and showcases the potential of
technology to enhance access to information in the digital age.
Reference
https://docs.oracle.com/javase/8/docs/
https://www.tutorialspoint.com/swing/index.htm
https://www.example.com/library-management-system
https://git-scm.com/doc
https://www.w3schools.com/java/
https://www.geeksforgeeks.org/java/
https://www.example.com/library-management-system
https://www.javacodegeeks.com/

You might also like