Question: Create a program to support a small hardware store. Your program will be able to keep track of items in the inventory of the store,

Create a program to support a small hardware store. Your program will be able to keep track of items in the inventory of the store, so that the owner knows the quantities of each item in stock. To represent an item in your program, create a class named Item with the following fields: > ID number (random string of length 5 can contain letters and numbers) > Name (string) > Category (string) - can only be one of the following: Door&Window, Cabinet& Furniture, Fasteners, Structural, Other. Quantity (integer) > Price (floating point number)

Your program should provide the user (store owner) with a command line choice menu about possible actions that they can perform. The choices should be the following: 1. Show all existing items in stock and their quantities. 2. Add a new quantity of a specific item to the stock. 3. Remove a certain quantity of a specific item type. 4. Search for an item (given its name or part of its name). 5. Show a list of all items below a certain quantity. 6. Exit program.

When the program first loads, it reads all the saved records (if any) from a file named database.txt into an ArrayList, and offers the user 6 choices (the same 6 choices listed earlier). The format of the contents of the database.txt file should be in human readable plain text, one record per line (note the ~ separator between different entries), e.g. While the program is running, the user can choose any of the 6 available options. 632VR~Nuts 1/2in~Fasteners~70~0.50 H43SM~Knobs 1-1/4in~Cabinet&Furniture~200~2.99 83RS9~Kwikset SmartLock~Door&Window~30~199.00

Selecting options 2 or 3 changesArrayList not database.txt.

Selecting the option 6 (exit program) invokes the following: The database.txt file will be updated automatically the program first saves all the contents of the ArrayList into database.txt file, replacing old files, and then exits.

Selecting no 6 (exit) replaces entries in database.txt with new entries from ArrayList before exiting.

When the program first loads, it reads all the saved records (if any) from a file named database.txt into an ArrayList, and offers user 6 choices (listed earlier). Selecting no 6 (exit) replaces entries in database.txt with new entries from ArrayList before exiting. The format of the contents of the database.txt file should be in human readable plain text, one record per line (note the ~ separator between different entries), e.g. 632VR~Nuts 1/2in~Fasteners~70~0.50 H43SM~Knobs 1-1/4in~Cabinet&Furniture~200~2.99 83RS9~Kwikset SmartLock~Door&Window~30~199.00

When displaying the items, print headers and format the data to line up in columns under the headers. ---------------------------------------------------------------------- | ID # | NAME | CATEGORY | QUANTITY | PRICE | ---------------------------------------------------------------------- | 632VR | Nuts 1/2in | Fasteners | 70 | 0.50 | | H43SM | Knobs 1-1/4in | Cabinet&Furniture | 200 | 2.99 | | 83RS9 | Kwikset SmartLock | Door&Window | 30 | 199.00 | ---------------------------------------------------------------------- Price should be output showing two decimal digits: (e.g 99.95). Be sure to validate the user input. You don't need to create any GUI for this assignment. Command line operations are enough.

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