Question: Design and implement Java program as follows: (1) There will be a Book Java class with following attributes: id, title, and price. a. The id

 Design and implement Java program as follows: (1) There will be

Design and implement Java program as follows: (1) There will be a Book Java class with following attributes: id, title, and price. a. The id is five digits (integer). b. Check id for length: error message. c. Check id for data type: error message. d. Check for duplicate id: error message. e. Prompt is redisplayed if there is an error in id entry. f . Title must allow for multiple words. g. The data type for price is either float or double. h. Array is populated only if all above elements are correctly entered. i. Confirmation message is displayed. (2) There will be an Inventory Java class which stores and manages a list of Book objects. (3) Inventory class will provide the following functionality: a. Add: Prompts user for book data and adds to the inventory list in array if all entries are correct. If the book already exists (based on id value), the add request will fail, an error message will be displayed to the console, and the program will redisplay the prompt for an id. The new book is added to the ArrayList b. Remove. Prompts user for book id, finds the id in the inventory ArrayList and removes it. A message is displayed with specific information about the book being removed. If the book matching the id is not in the inventory, remove request will fail and an error message will be displayed to the console. The program will redisplay the prompt for a correct id. c. Find: Prompts user for book id, finds the id in the inventory list and displays all the data for the book (id. title. and price) horizontally. If the book matching the id is

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 Mathematics Questions!