-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels