You are required to provide an algorithm to operate a cash register that will keep count of all withdrawals and deposits made during a day’s business operation. For simplicity, this cash register will handle notes with the value of $50, $20, $10 and $5 only, and coins with value of $1, 20 cents and 10 cents only. The cash register must know the total of each denomination in the register at the start of the day. At closing time, the cash register must print out the totals of each denomination still in the register; the general total of money that is in the register; the total deposits and the total withdrawals for the day.
Your solution will require the user to enter the starting number of each note and coin present in the register at the start of the day. The algorithm should also request the type of transaction and amount each time. If it is a deposit then the number of each bill and coin needs to be known. In the case of a withdrawal, the operator must calculate the number of each denomination to be taken out of the register. The cash register cannot hold a balance of less than 10 cents. (HINT: totals of everything must be kept at all times)