Use java to program that models a general store and allows users to interact with the data
Question:
Use java to program that models a general store and allows users to interact with the data it contains.
- The program must allow a user to add new items and place them to the stores stock. This should include the ability to add duplicates of the same item.
- The program must allow a user to sell items and remove them from the store (CSV writer). This should allow a user to add the item to a cart first before choosing to check out(Bean To CSV).
- The program must allow a user to search for an item in the store with a given name supplied by the user(CVS reader).
- The program must allow a user to modify items in the store (e.g. updating the price or name). These changes need to be applied to all instance of the item.
- The program must be able to exit when the user requests to finish.
Use descriptive names for all variables and methods Use appropriate programming conventions, i.e. correct naming and capitalization Use methods to break up large pieces of code into smaller, single focused tasks No data handling in main method. Your file operations should be handled by other methods The file I/O needs to implement try/catches
An example data file has been provided with an initial stock for your store to use. For the file provided, rows appear as one of three varieties:
Produce Items are fresh food that will expire if not sold. Items of this type have the following format which contains the item's name, price, and expiration date: banana,0.62,04/29/2022
Shelved Items are any item that are either shelf-stable food or non-food items. Items of this type have the following format which contains the item's name and price: pencil,1.29
Age Restricted Items are any item that has a restriction on purchasing it based on the age of the customer. Items of this type have the following format which contains the item's name, price, and the age restriction: wine,12.99,21
The file that will serve as the inventory from the start that the user should be able to view :
stock.csv :
banana,0.62,04/29/2022 banana,0.62,04/29/2022 banana,0.62,04/29/2022 banana,0.62,04/29/2022 banana,0.62,04/29/2022 banana,0.62,04/29/2022 banana,0.62,04/29/2022 banana,0.62,04/29/2022 carrot,0.62,04/29/2022 carrot,0.62,04/29/2022 carrot,0.62,04/29/2022 carrot,0.62,04/29/2022 carrot,0.62,04/29/2022 carrot,0.62,04/29/2022 apple,0.50,04/29/2022 apple,0.50,04/29/2022 apple,0.50,04/29/2022 apple,0.50,04/29/2022 avocado,1.50,04/29/2022 avocado,1.50,04/29/2022 avocado,1.50,04/29/2022 avocado,1.50,04/29/2022 bread,3.50,04/29/2022 bread,3.50,04/29/2022 bread,3.50,04/29/2022 bread,3.50,04/29/2022 bag of chips,0.99,04/29/2022 bag of chips,0.99,04/29/2022 bag of chips,0.99,04/29/2022 bag of chips,0.99,04/29/2022 pencil,1.29 pencil,1.29 pencil,1.29 pen,1.79 pen,1.79 pen,1.79 pen,1.79 pad of paper,3.00 pad of paper,3.00 pad of paper,3.00 bottle of water,1.00,04/29/2023 bottle of water,1.00,04/29/2023 bottle of water,1.00,04/29/2023 bottle of water,1.00,04/29/2023 bottle of juice,1.19,04/29/2022 bottle of juice,1.19,04/29/2022 bottle of juice,1.19,04/29/2022 bottle of juice,1.19,04/29/2022 bottle of juice,1.19,04/29/2022 wine,12.99,21 wine,12.99,21 wine,12.99,21 beer,10.99,21 beer,10.99,21 beer,10.99,21 cold meds,24.99,18 cold meds,24.99,18
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr