Question: IN JAVA PLEASE COMPLETE ALL CLASSES AND METHODS INCLUDING MAIN Objective: Design and implement a Java program for managing a book inventory system for a

IN JAVA PLEASE COMPLETE ALL CLASSES AND METHODS INCLUDING MAIN
Objective: Design and implement a Java program for managing a book inventory system for a
popular bookstore chain. The program should allow users to perform various operations such as
adding books, deleting books, updating book information, searching for books, and displaying
the entire inventory. There should also be a method to calculate the total value of the collection
for inventory taxes. All book information should be stored in a file and loaded into an array when
the program starts. Changes made during the program's execution should be reflected in the file
by writing back changes to the file.
Requirements:
1. Create a Book class with the following attributes:
o title
o ISBN (unique for each book)
o Author
o yearOfPublication
o retailPrice
o quantityOnHand
o Methods
1. constructors
2. Accessors
3. Mutators
4. toString
2. Create an Author class with the following attributes
o name
o birthYear
o nationality
o Methods
1. constructors
2. Accessors
3. Mutators
4. toString
5..equals
1. Two authors are equal if their name and birth year are equal
3. Implement a BookInventory class to manage the book inventory system. This class
should include methods for:
o Reading the book inventory from a file into a single-dimensional array.
o Writing the current book inventory back to the file, replacing the original content.
o Adding a new book to the inventory.
o Deleting a book from the inventory.
o Updating book information.
o Searching for a book by title, Author, or ISBN.
1. Overload three search methods
o Displaying the entire inventory.
o Changing the price of all books by a fixed percentage (during sales)
o Calculating the retail value of the entire inventory
4. Ensure that the program gracefully handles file I/O exceptions and invalid user inputs.
Instructions:
1. Start by creating the Book and Author classes with appropriate attributes, constructors,
accessor and mutator methods.
2. Implement the BookInventory class with the required methods.
3. Write a main method to create an instance of the BookInventory class and provide a
menu-driven interface for users to interact with the inventory system.
4. Use file I/O operations to read the initial inventory from a file when the program starts
and save any changes back to the file before exiting.
5. Implement validation checks for user inputs (e.g., ensure price and quantity are positive
numbers).
6. You should implement error handling for cases such as duplicate book entries or
attempting to delete a non-existent book.
7. Make sure the search functionality allows for case-insensitive searches.
8. Test your program thoroughly to ensure all functionalities work as expected.
Note: Feel free to reach out if you need further clarification or assistance with any aspect of the
assignment.
Design Requirements:
Create a class diagram for two classes- Book and Author, and pseudocode for
BookInventory
The classes should be placed in a package with the name edu.ilstu
OUTPUT:
1. Read Book Inventory from a file
2. Write Book Inventory to a file
3. Add a new book to Inventory
4. Delete a book from inventory
5. Search for a book by title
6. Search for a book by author
7. Search for a book by ISBN
8. Display inventory
9. Change sale price of all books
10. Calculate total value of inventory on hand
11. Exit
Enter your selection: 1
Enter file name: BooksAndAuthors.csv
Inventory successfully loaded with 33 books
1. Read Book Inventory from a file
2. Write Book Inventory to a file
3. Add a new book to Inventory
4. Delete a book from inventory
5. Search for a book by title
6. Search for a book by author
7. Search for a book by ISBN
8. Display inventory
9. Change sale price of all books
10. Calculate total value of inventory on hand
11. Exit
Enter your selection: 2
Inventory successfully written to file BooksAndAuthors.csv
1. Read Book Inventory from a file
2. Write Book Inventory to a file
3. Add a new book to Inventory
4. Delete a book from inventory
5. Search for a book by title
6. Search for a book by author
7. Search for a book by ISBN
8. Display inventory
9. Change sale price of all books
10. Calculate total value of inventory on hand
11. Exit
Enter your selection: 3
Enter title: Anna Karenina
Enter ISBN-13: 9798560833640
Enter Author Name: Leo Tolstoy
Enter Author Birth Year: 1828
Enter Author Nationality: Russian
Enter publication date: 1878
Enter price: 12.99
Enter number on hand: 6
Anna Karenina successfully added to inventory
1. Read Book Inventory from a file
2. Write Book Inventory to a file
3. Add a new book to Inventory
4. Delete a book from inventory
5. Search for a book by title
6. Search for a book by author
7. Search for a book by ISBN
8. Display inventory
9. Change sale price of all books
10. Calculate total value of inventory on hand
11. Exit
Enter your selection: 4
Enter ISBN to delete: 9780064471046
Deleting The Lion, The Witch, and the Wardrobe
Okay to proceed? (yes/no): yes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!