Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are tasked with developing a Library Management System in Java. The system should allow librarians to manage the library's collection of books and assist
You are tasked with developing a Library Management System in Java. The system should allow librarians to manage the library's collection of books and assist clients in borrowing and returning books. Additionally, clients should be able to search for books by title or author.
Requirements:
Book Class:
Create a Book class with the following attributes:
title String: The title of the book.
author String: The author of the book.
available boolean: The availability status of the book true if available, false if borrowed
Implement appropriate getter and setter methods for each attribute.
Library Class:
Create a Library class to manage the library's collection of books. Include methods to:
Add a new book to the library.
Display a list of available books.
Allow clients to borrow books.
Allow clients to return books.
Search for books by title or author.
User Interface:
Implement a simple commandline interface CLI for librarians and clients to interact with the system.
Provide menu options for librarians to perform actions such as adding books, displaying available books, searching for books, borrowing books, and returning books.
Allow clients to search for books by title or author.
Sample Data:
Add at least three sample books to the library's collection during initialization.
Functionality:
When a client borrows a book, update the book's availability status to reflect that it is no longer available.
When a client returns a book, update the book's availability status to reflect that it is available again.
Implement search functionality to allow clients to search for books by title or author.
Error Handling:
Implement basic error handling to handle cases such as invalid input and book availability checks.
Testing:
Test the functionality of the system by performing various actions such as adding books, searching for books, borrowing books, and returning books. Include screenshots of your output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started