Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions atm_challenge.md
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.
Comment on lines +5 to +6
Copy link
Member

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.


Source: https://dojopuzzles.com/problems/caixa-eletronico/

> PS the source is in portuguese.
Copy link
Member

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

The 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.