TL;DR the link: Coins are only legal tender up to a certain amount. For example 21p in 1p's is not classed as legal tender.
(Is it only me who can only say "legal tender" in a scottish accent > "I think you'll find that's...")
Lock me up and throw away the key.
(Fortunately it was a self-checkout so no witnesses).
---
while(moneyGotSoFar < targetMoneyToget)
{
// code to interface with hardware device which
// is taking in money
// NOTE: moneyGotInThisBurst would be told by the
// hardware device software
...
// some time out code. And exception handling if
// no cash entered
moneyGotSoFar += moneyGotInThisBurst;
}---
So point is, the developers may not think upfront of these kind of cases. And this case can be a boundary condition test case - May potentially test any array overflows. Or some looping done the wrong way. Or out of memory if it has been coded in Java(Oops. Sorry :-))
The reason for the laws surrounding debt is to prevent creditors from purposefully holding debtors in debt by refusing to accept their payments ('Oh, sorry, you HAVE to pay me in this form, so I'll refuse your payment and instead charge you an extra day of interest, etc.)
Also, paying for your groceries in that way (self-checkout) isn't discharging a debt as no debt was incurred: You could have decided not to pay and put the groceries back, after all.
Lets thank the comical Michael McIntyre for that!
That actually comes under the letter of the law: http://www.royalmint.com/aboutus/policies-and-guidelines/leg...
Not to detract from your overall point though, which is 100% correct.