Skip to content

Alextz307/VendingMachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vending Machine Console App

Overview

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.

Features

  • 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.

Use Cases

The primary use cases covered in this implementation are:

1. Product Browsing

  • View available products.

2. Product Purchase

  • Select and buy a product.
  • Handle cases where the product is out of stock.

3. Payment

  • Pay for the product using cash or card.
  • Handle payment errors such as cancellation.

4. Admin Reports

  • Generate sales, volume, and stock reports.

Getting Started

Prerequisites

  • .NET SDK installed on your machine.

Running the Application

  1. Clone the repository.
  2. Open the project in your preferred C# IDE (e.g., Visual Studio, Visual Studio Code).
  3. Build the project to restore dependencies.
  4. Run the application from the console.

Usage

  • The user can browse products and make a purchase.
  • The admin can generate different types of reports and log out.

Error Handling

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.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages