This is a console-based Vending Machine application built during Nagarro's Remote Learning Program, using C# and .NET. The application simulates the basic functionalities of a vending machine, allowing users to browse available products, make purchases, and pay using different payment methods.
-
Browse Products: Users can view the list of available products.
-
Purchase Products: Users can select and buy products from the vending machine.
- Stock Management: The system checks if the selected product is in stock. If not, it shows an "Insufficient Stock" error.
-
Payment Handling: Users can pay for their selected products using either cash or a card.
- Cash Payment: Users can choose to pay by cash.
- Card Payment: Users can choose to pay by card.
- Payment Errors: The system handles payment errors, such as a "Payment Canceled" error for unsuccessful transactions.
-
Admin Functionality: An admin can generate various reports:
- Sales Report: Displays the total sales generated by the vending machine.
- Volume Report: Shows the number of products sold.
- Stock Report: Provides the current stock status of products in the machine.
The primary use cases covered in this implementation are:
- View available products.
- Select and buy a product.
- Handle cases where the product is out of stock.
- Pay for the product using cash or card.
- Handle payment errors such as cancellation.
- Generate sales, volume, and stock reports.
- .NET SDK installed on your machine.
- Clone the repository.
- Open the project in your preferred C# IDE (e.g., Visual Studio, Visual Studio Code).
- Build the project to restore dependencies.
- Run the application from the console.
- The user can browse products and make a purchase.
- The admin can generate different types of reports and log out.
The application is designed to handle the following errors gracefully:
- Insufficient Stock: Displayed if the selected product is out of stock.
- Payment Canceled: Displayed if a payment transaction is canceled or fails.