Question: Ruby Language Create a cash register that can keep track of money and dispense change. The register should be able to handle bills of denominations

Ruby Language
Create a cash register that can keep track of money and dispense change. The register should be able to handle bills of denominations 20, 10, 5, 2 and 1. Given a dollar amount, the register should be able to dispense the appropriate number of bills to make that change. In cases where change cannot be made using the bills in the register, you should raise an error.
REQUIREMENTS
Must handle denominations 20, 10, 5, 2, and 1
Must be able to represent available moneys as a string
Must be able to add money to register
Must be able to take money from register
Must be able to dispense change for dollar amounts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!