Skip to content

Instantly share code, notes, and snippets.

@xpepper
Created November 20, 2021 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpepper/0d7bfb70daf49a64ddee527594b56fb1 to your computer and use it in GitHub Desktop.
Save xpepper/0d7bfb70daf49a64ddee527594b56fb1 to your computer and use it in GitHub Desktop.
tags
kata

ATM kata

You have to develop an Automated Teller Machine (ATM) allowing cash withdrawals.

The ATM main features:

  • it allows cash withdrawals with the following denominations: 5 €, 10 €, 20 €, 50 €
  • it keeps track of the currently available amount of banknotes on the different denominations (e.g. how many 20 € notes are still available in the ATM)
  • it raises an error condition if the notes are not enough to complete the requested cash withdrawal
  • it gives priority to the higher value denominations first before using the smaller denominations
  • it can be configured to support different denomination sizes and currencies (e.g. 5 $, 10 $, 20 $, 50 $, 100 $)

(taken from https://www.youtube.com/watch?v=fkhm5kOUeJU)

Credits to Piergiuliano Bossi for the original kata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment