-
Notifications
You must be signed in to change notification settings - Fork 3
Add ATM challenge #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # ATM challenge | ||
|
|
||
| ## Introduction | ||
|
|
||
| This challenge is to write a software for an ATM, where a few rules, must be applied in order to | ||
| withdraw money. | ||
|
|
||
| Source: https://dojopuzzles.com/problems/caixa-eletronico/ | ||
|
|
||
| > PS the source is in portuguese. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Portuguese* (capital letter) |
||
|
|
||
| ## Exercise | ||
|
|
||
| Develop a software that simulates a withdraw where the the user inputs the money amount and the | ||
| software outputs is the money bills the user can take from the machine, following the rules: | ||
|
Comment on lines
+14
to
+15
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Develop a software that simulates a withdrawal where the user inputs the money amount and the software outputs the money bills the user will receive from the machine, following the rules: |
||
|
|
||
| - The sofware needs to delivery as low money bills as possible. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. software* |
||
| - Is only possible to withdraw valid amounts according to the available money bills. | ||
| - There is no need to check the user's balance. | ||
| - There is no need to count the number of available money bills. | ||
| - The available money bills as $2, $5, $10, $20, $50. | ||
|
|
||
| ### Use case | ||
|
|
||
| #### Case 1 | ||
|
|
||
| Given the user which wants to withdraw $30. | ||
|
|
||
| The software needs to return one money bill for $20 and one for $10. | ||
|
|
||
| #### Case 2 | ||
|
|
||
| Given the user which wants to withdraw $45. | ||
|
|
||
| The software needs to return two money bill for $20 and one for $5. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. two money bills* |
||
|
|
||
| #### Case 3 | ||
|
|
||
| Given the user which wants to withdraw $21. | ||
|
|
||
| The software needs to return an error since there is not available money bill to deliver $21. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the software is not capable of delivering $21. |
||
|
|
||
| ### Global Requirements | ||
|
|
||
| - The challenge can be develop using any programming language. | ||
| - No external external service and library needs to be used | ||
| - The solution must have a way to execute, CLI, file or any other interaction. | ||
| - Tests are always welcome | ||
| - Create a README file with instructions on how to run the application and the tests. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This challenge is to write software for an ATM where a few rules must be applied to
withdraw money.