To run locally just type:
$ npm i
$ npm run serve
Or access the live demo.
This is an exercise that simulates an ATM (Cash Machine). It was written in Vanilla Javascript (ES6).
The rules are simple:
- It should always deliver the lowest number of bills
- It's possible to get the amount requested with available bills
- The client balance is infinite
- Amount of bills/money is infinite
- Available bills $100, $50, $20 and $10
Entry: 30
Result: { 20: 1, 10: 1 }
Entry: 80
Result: { 50: 1, 20: 1, 10: 1 }
Entry: 280
Result: { 100: 2, 50:1 , 20: 1, 10: 1 }
Entry: 125
Result: throw NoteUnavailableException
Entry: -130
Result: throw InvalidArgumentException
Entry: NULL
Result: throw [EMPTY SET]
Clone the repository and then go to the folder
$ git clone git@github.com:gerisztein/atm-es6.git
$ cd atm-es6
Install all the dependencies
$ npm install
Serve it locally
$ npm run serve
Right after that, it'll open the browser.
Usually the URL is http://localhost:8080.
A working version of the project is also available here.
https://gerisztein.github.io/atm-es6
- Webpack
- Webpack - Module Bundler
- Webpack-CLI - CLI Tools
- Webpack-Serve - Dev Server
- Some webpack plugins
- Vanilla Javascript (ES6)
- Husky and Commitlint - Commit linter
- TravisCI - Continuous Integration
MIT License © Lucas Gerisztein