Skip to content

SoftWriters/CashRegister

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

Cash Register

The Problem

Creative Cash Draw Solutions is a client who wants to provide something different for the cashiers who use their system. The function of the application is to tell the cashier how much change is owed and what denominations should be used. In most cases the app should return the minimum amount of physical change, but the client would like to add a twist. If the total due in cents is divisible by 3, the app should randomly generate the change denominations (but the math still needs to be right :))

Please write a program which accomplishes the clients goals. The program should:

  1. Accept a flat file as input
    1. Each line will contain the total due and the amount paid separated by a comma (for example: 2.13,3.00)
    2. Expect that there will be multiple lines
  2. Output the change the cashier should return to the customer
    1. The return string should look like: 1 dollar,2 quarters,1 nickel, etc ...
    2. Each new line in the input file should be a new line in the output file

Sample Input

2.12,3.00

1.97,2.00

3.33,5.00

Sample Output

3 quarters,1 dime,3 pennies

3 pennies

1 dollar,1 quarter,6 nickels,12 pennies

*Remember the last one is random

Additional Information

This exercise is used to help us get a better picture of how you approach and solve for a given problem. Your submission will be evaluated based on a variety of criteria including, but not limited to, product quality, demonstrated knowledge of system design and coding best practices, completeness, and ease of use from a consumer and engineering teammate perspective. The completed solution should give us a good picture of your abilities and style, so feel free to use the programming language and tools with which you are most comfortable.

Prior to submission, please fork this repository. If your solution includes code auto generated by a development tool, please use an additional commit to clearly separate it from your own work. When you have completed your solution, please issue a pull request to notify us that you are ready.

Have fun!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published