Question: Objective: Build a C # program that manages a list of products in an inventory. The program should allow users to add, search, and

Objective: Build a C\# program that manages a list of products in an inventory. The program should allow users to add, search, and display products, as well as save/load inventory data to and from a file.
Project Requirements
1. Product Class: Create a class with the following properties:
- Product ID (string): A unique identifier for the product.
- Name (string): The product name.
- Price (decimal): The product price.
- Quantity in Stock (int): The number of items in stock.
2. Main Program Functionalities:
- Add Product: Allow the user to add a new product to the inventory. Check for duplicate product IDs and handle them gracefully with an exception.
- Search Product: Let the user search for a product by ID or name. If the product is not found, handle it with an exception and display a user-friendly message.
- Update Stock: Provide an option to update the stock of a specific product.
- Display Inventory: Display a list of all products in the inventory with their details (ID, name, price, quantity).
3. File Handling:
- Save Inventory: Save the current inventory to a file (e.g., inventory.txt). Each line in the file should contain a product's details in a structured format (e.g., CSV).
- Load Inventory: Load inventory data from a file. Handle exceptions if the file is not found or if there's a formatting error in the data.
Objective: Build a C \ # program that manages a

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!