Page 1 of 1

Project Description: A grocery shop wants to hire you to design a system to help them manage their inventory. They will

Posted: Sat May 14, 2022 7:00 pm
by answerhappygod
Project Description A Grocery Shop Wants To Hire You To Design A System To Help Them Manage Their Inventory They Will 1
Project Description A Grocery Shop Wants To Hire You To Design A System To Help Them Manage Their Inventory They Will 1 (149.69 KiB) Viewed 36 times
Project Description: A grocery shop wants to hire you to design a system to help them manage their inventory. They will provide you with details about their products stored in a file called “Products.txt”. Each line in the file is a record about a unique product information. The provided product details in each line of the file are: <Product ID, Product Name, Product Price, Product Quantity> 12453 Peanut_Butter 18.9 10 Note that the number of unique products in the file must not exceed 20. Project Requirements: Write a Java program that helps the shop's employees in managing and displaying the products details. Your main method should: Use readDetails method to read products details from a file and validate them. Show a menu of options where the user will be asked to choose a certain option then call the corresponding method related to that option. The program should keep displaying the menu until the user selects to exit. . Sample Menu: **** ** Grocery Shop Inventory System ** *** ***** 1. Search for a product 2. Find product (s) with maximum inventory 3. Find product (s) with minimum inventory 4. Buy product(s) 5. Print products details 6. Exit ***** ********* What is your choice?:

System Details: Your program must contain the following methods: . . . 1. readDetails This method must: Access the file "Products.txt" to get the ID, name, price, and quantity of each product Call checkValidID method to check the validation of each ID in the IDs array. Call checkValidName method to check the validation of each product name in the names array. Call checkValidPrice method to check the validation of the prices in the prices array. Call checkValidQty to check the validation of the quantities in the gtys array. Save the data in IDs[20], names(20), prices[20] and qtys[20] arrays • Notify the user when all the data is saved successfully 2. checkValidID This method must: Check if an ID is valid. The ID is valid if it is a string of five digits (contains numeric characters) In case of invalid ID, the ID will be printed, and the user must be prompted to enter a new value. The method must be terminated only in case of a valid ID is entered. 3. checkValidName This method must: Check if a product name is valid. The name is valid if it contains only letters or underscore. Assume that name is separated by underscores instead of spaces, like: "Peanut_Butter”. In case of invalid product name, the name will be printed, and the user must be prompted to enter a new value. The method must be terminated only in case of a valid name is entered. 4. checkValid Price This method must: Check if a product price is valid. The price is valid if it is a positive number. In case of invalid price, the price will be printed, and the user must be prompted to enter a new value. The method must be terminated only in case of a valid price is entered. 5. checkValidQty This method must: Check if a product quantity is valid. The quantity is valid if it is a positive integer number or zero. .

. . . . In case of invalid quantity, the quantity will be printed, and the user must be prompted to enter a new value. The method must be terminated only in case of a valid quantity is entered. 6. search Product This method is used to search for a product. When the user selects "Search for product" option, the method must be called. This method must: Give the user the chance to search by product ID (full or part of it) or by product name (full or part of it). Print all the products matching the criteria and if none was found an appropriate message should be printed. Note: The search needs to accept all cases of letters as the user can search using lower-case letters or upper-case letters. 7. find Maximum This method is used to find product(s) with the maximum inventory in the warehouse. When the user selects "Find product(s) with maximum inventory" option, the method must be called. This method must: Find the product(s) with the highest quantity value Print the details of all products matching the criteria 8. find Minimum This method is used to find product(s) with the minimum inventory in the warehouse. When the user selects "Find product(s) with minimum inventory" option, the method must be called. This method must: Find the product(s) with the lowest quantity value Print the details of all products matching the criteria 9. buy Products This method is used to help the shop employees to place an order on behalf of a customer. When the user selects "Buy product(s)" option, the method must be called. This method must: Ask for the number of unique products to buy (must not exceed the number of unique products currently available in the warehouse) Ask for the product ID and the number of quantities to buy for each unique product o Check the validity of the product ID and number of quantities to buy The ID must be a five digits numerical String and must be currently available in the list of products The quantity must be a positive integer number and must not exceed the current number of quantities of that product in the warehouse Ask for the total cash the buyer will pay . . .