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

Department of Computer Science and Engineering

Shri Sai Institute of Technology, Aurangabad


(2023-2024)
Subject:- JPR
A Project Report
On
“ library management system”
Submitted by :-
Sujal Sonawane {2215420044}
Yash Puse {2215420055}
Rohit Badak {2215420114}
Arya Kundalwal {2215240068}
Mayank Kulkarni {2215420058}

In partial fulfilment for the award of


Diploma in
Computer Science and Engineering
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION (MSBTE), MUMBAI, INDIA

CERTIFICATE
This is certified that, the project report entitled “ library management system ”
Submitted by Sujal Sonawane{2215420044} ,Yash Puse {2215420055},Rohit Badak
{2215420114},Arya Kundalwal{2215240068},Mayank Kulkarni{2215420058}. Has
completed as per the requirement of Maharashtra State Board of Technical
Education in partial fulfilment of Diploma in Computer Science and Engineering.

Place: Chatrapati sambhajinagar


Data: / /

Prof. Gaikwad V.M. Sign Sign


HOD-CW External Examiner Subject Teacher

Prof. Mr. P.S. TAYDE


Principal

Shri Sai Institute of Technology (Polytechnic),


Aurangabad

DECLARATION

We hereby declare that we have performed, completed and written the project
entitled “ library management system”. It has not previously submitted for the
basis of the award of any other degree or diploma or other similar title of his for
any other diploma/examining body or university to the best of knowledge and
belief.

Place: Chatrapati sambhajinagar


Date: / /

Sujal Sonawane {2215420044}


Yash Puse {2215420055}
Rohit Badak {2215420114}
Arya Kundalwal{2215240068}
Mayank Kulkarni {2215420058}
INDEX
Sr. No. Content Page no.
1 About project
2 Code
3 Output
ABOUT PROJECT

In today's digital era, libraries face the challenge of efficiently managing


vast collections of resources while providing seamless services to
patrons. This project focuses on developing a sophisticated Library
Management System (LMS) to address these challenges. By
leveraging cutting-edge technologies, such as data analytics, cloud
computing, and machine learning, our LMS aims to streamline library
operations, enhance user experience, and optimize resource utilization.
This text outlines the key components, features, and benefits of our
innovative Library Management System
CODE

import java.util.*;

class Book {
private String title;
private String author;
private boolean isAvailable;

public Book(String title, String author) {


this.title = title;
this.author = author;
this.isAvailable = true;
}

public String getTitle() {


return title;
}

public String getAuthor() {


return author;
}

public boolean isAvailable() {


return isAvailable;
}

public void setIsAvailable(boolean available) {


isAvailable = available;
}
}

class Library {
private ArrayList<Book> books;

public Library() {
books = new ArrayList<>();
}

public void addBook(Book book) {


books.add(book);
}

public void issueBook(String title) {


for (Book book : books) {
if (book.getTitle().equalsIgnoreCase(title) && book.isAvailable()) {
System.out.println("Book issued: " + title);
book.setIsAvailable(false);
return;
}
}
System.out.println("Book not available: " + title);
}

public void returnBook(String title) {


for (Book book : books) {
if (book.getTitle().equalsIgnoreCase(title) && !book.isAvailable()) {
System.out.println("Book returned: " + title);
book.setIsAvailable(true);
return;
}
}
System.out.println("Invalid book return: " + title);
}

public void displayAvailableBooks() {


System.out.println("Available Books:");
for (Book book : books) {
if (book.isAvailable()) {
System.out.println(book.getTitle() + " by " + book.getAuthor());
}
}
}
}

public class LibraryManagementSystem {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Library library = new Library();

// Adding some sample books


library.addBook(new Book("Java Programming", "John Doe"));
library.addBook(new Book("Python Basics", "Jane Smith"));
library.addBook(new Book("Algorithms", "Alice Johnson"));

int choice;
do {
System.out.println("\nLibrary Management System");
System.out.println("1. Issue a book");
System.out.println("2. Return a book");
System.out.println("3. Display available books");
System.out.println("4. Exit");
System.out.print("Enter your choice: ");
choice = scanner.nextInt();
scanner.nextLine(); // Consume newline character
switch (choice) {
case 1:
System.out.print("Enter the title of the book to issue: ");
String issueTitle = scanner.nextLine();
library.issueBook(issueTitle);
break;
case 2:
System.out.print("Enter the title of the book to return: ");
String returnTitle = scanner.nextLine();
library.returnBook(returnTitle);
break;
case 3:
library.displayAvailableBooks();
break;
case 4:
System.out.println("Exiting...");
break;
default:
System.out.println("Invalid choice. Please try again.");
}
} while (choice != 4);

scanner.close();
}
}
Output

You might also like