Skip to content

Add a Cash Register Program in Cpp #378

@anubhootipandey

Description

@anubhootipandey

The function checkCashRegister(price, cash, cid) simulates a real cash register.

It takes:

  • price → cost of the item
  • cash → amount given by the customer
  • cid → cash-in-drawer (array showing how much of each denomination is in the drawer)

And returns:

  • Whether the drawer is OPEN, CLOSED, or has INSUFFICIENT_FUNDS,
  • Along with how much change to return (and in which denominations).

Hello, I would like to contribute this cash register program to the repository. It uses a greedy algorithm to handle cash transactions and determine change accurately. Please let me know if I can submit a pull request for review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions