Cash Register

An algorithm game

Instructions

Cash Register is a program that tells you how many and which coins and/or bills you should give as change (based on what's available in the drawer).

It works as follows:

  1. Enter the Purchase price and Cash recived (e.g. the item cost 15.50 and you received a 20 bill)
  2. Enter how many of each coin or bill you have in the Drawer (for example, 2 hundreds, 1 twenty, 14 tens, 3 fives, and so on...)
  3. Click/tap the CALCULATE CHANGE button
  4. in the Change line, you'll see how many of which bill you ought to give
  5. in the Status line, you'll see whether your cash register is
    • OPEN (there is money left),
    • CLOSED (no money left),
    • or if you have INSUFFICIENT FUNDS and could not give the change

Change:

Status:

Number of bills and coins in the drawer: