Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Library Management System Submission Deadline: 1 6 th Hanes 2 0 2 4 Objective: Create a Java program named L 1 braryManagementsystem. Java to simulate
Library Management System
Submission Deadline: th Hanes
Objective: Create a Java program named LbraryManagementsystem. Java to simulate a
management system for a library.
Part : Book Class Implementation
Implement the Book class with the following properties:
baradString: Unique identifier for the book. Ensure it's not empty or muse
isEmpty method
ttle String: Title of the book. Ensure it's not empty or null
author String: Author of the book. Ensure it's not empty or null
avaabty beolean: Whether the book is available for borrowing.
borrower String: Name of the person who borrowed the book empty if the book is
available
Include the following methods in the Book class:
Constructors: Implement default and parameterized constructors to initialize the
properties of the Book object.
Getter and Setter Methods: Implement getter and setter methods for each property to
access and modify the object's state. Ensure validation in setters where applicable
Part : Library Management System Implementation
Implement a menudriven interface using a switch statement with the following options:
Add a New Book:
Prompt the user to enter book ID title, author, and availability.
Validate that the book ID title, and author are not empty or null.
Ensure the book ID is unique no duplicate book IDs
Allow adding multiple books using a while loop if desired.
Display All Books:
Display details of all books book ID title, author, availability, and borrower
Search for a Book:
Prompt the user to enter a book ID and display its details if found.
Validate that the book ID is not empty or null.
Borrow a Book:
Prompt the user to enter a book ID and the borrower's name.
Validate that the book ID and borrower's name are not empty or null.
Update the availability and borrower details if the book is available.
Display appropriate messages if the book is not available or not found.
Return a Book:
Prompt the user to enter a book ID to mark it as returned.
Validate that the book ID is not empty or null.
Make the book available again and clear the borrower's name.
Display appropriate messages if the book was not borrowed or not found.
Exit the System:
Exit the library management system.
Use an Array of Book Objects
Maintain an array of Book objects to store and manage book records.
Ensure that the array is appropriately sized to accommodate the maximum expected
number of books.
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