This program simulates a cash register. The user can calculate the appropriate change due to a customer based off of a sale amount, the amount of cash given by the customer, and the current state of the cash drawer. The sale amount and cash-given amount are editable by the user, and the cash drawer can by randomized, emptied, or each slot can be configured to the user's desired dollar amount.
The main program is the "src/utilities/make-change.ts" file.
NOTE: Version 1.1.0 of this program calculates the bills/coins with the highest value possible given the amount of change due to the customer. Future versions will give sub-optimal change if the state of the cash-drawer requires it (for example, it will return a lot of smaller bills that add up to the amount due if there is not a better option with bigger bills). Version 1.1.0 is a sort of brute-force solution that follows the recursive decision tree out to the leaf nodes, but cannot yet backtrack up the tree when an ideal solution is not reached initially. Future versions will use the Dynamic Programming paradigm with memoization or tabulation in order to solve this problem. The primary focus of this first version was to deploy a UI for the program using a front-end development tool that was new to me (Svelte) at the initial time of development, and to delpoy a program written primarily in TypeScript. The next goal is to optimize the main program.