Vending Machine
Problem Statement:
Design a control system for a vending machine that can dispense products while keeping track of product availability, stock, and cash balance. The system should be able to handle transactions, including cash, credit/debit card, and mobile payments, and provide the user with change if necessary. Additionally, the system should be able to handle multiple transactions simultaneously and provide an interface for management to monitor the machine's status, stock, and usage.
Requirements:
- Keep track of product availability, stock, and cash balance.
- Handle transactions, including cash, credit/debit card, and mobile payments.
- Provide the user with change if necessary.
- Handle multiple transactions simultaneously.
- Provide an interface for management to monitor the machine's status, stock, and usage.
Example:
A customer inserts a $5 bill into the vending machine to purchase a $2 bottle of water. The control system should recognize the amount inserted, subtract the cost of the product, and dispense the change ($3) to the customer. The system should also update the available stock and cash balance accordingly. The management should be able to access the vending machine's interface to see the updated stock and cash balance, as well as monitor its usage over time.