You are tasked with implementing a basic library system in Java. The program sho

WRITE MY ESSAY

You are tasked with implementing a basic library system in Java. The program sho

You are tasked with implementing a basic library system in Java. The program should allow users to add books to the library, borrow books, and return books. The system maintains a record of the available quantity of each book.
Question:
Write a Java program that accomplishes the following tasks:
1. Implement the following options:
Add Books
Borrow Books
Return Books
Exit
2. For “Add Books”:
Prompt the user to enter the book title, author, and quantity.
If the book already exists in the library, update the quantity.
If the book is new, add it to the library.
3. For “Borrow Books”:
Prompt the user to enter the book title and the number of books to borrow.
Check if the requested number of books is available in the library.
If the books are available, update the quantity and display a success message.
If not, display an error message.
4. For “Return Books”:
Prompt the user to enter the book title and the number of books to return.
Check if the books being returned belong to the library system.
If they do, update the quantity and display a success message.
If not, display an error message.
5. Handle invalid input and display appropriate error messages.
6. Implement an exit option to allow the user to exit the program.
Remember to use appropriate variable names and follow coding best practices.
Submit the assignment in MS Word or PDF file format. Your submission should contain the program code, explanation, and output screenshot

WRITE MY ESSAY

admin Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *