News for hackers. Stuff that matters.
Re:Where did the other dollar go, Jeff? by StevenWaterman on Wednesday April 28, 2021 @11:04AM (#26970191)
It clicked for me when I allowed negative balances

  Customers: 0 -30 -30 -27
  Hotel    : 0  30  25  25
  Bellhop  : 0   0   5   2
  Total    : 0   0   0   0
Re:Where did the other dollar go, Jeff? by Joker_vD on Wednesday April 28, 2021 @11:38AM (#26970606)
"The bellhop, who is very nice, takes $5 from the register and return $2 to each tourist, paying $1 from his pocket— the guests don’t have to fuss over uneven change that way.

Now, each of the three tourists has spent $8, for a total of $24. The bellhop has spent $1, which brings the total to $25. Where did the other 5 dollars go?"

"The bellhop, who is very much not honest, takes $10 from the register and return only $1 to each tourist, pocketing the remaining $7— the guests don’t have to fuss over uneven change that way.

Now, each of the three tourists has spent $9, for a total of $27. The bellhop has retained $7, which brings the total to $34. Where did those other 4 dollars come from?"

Re:Where did the other dollar go, Jeff? by rthomas6 on Wednesday April 28, 2021 @11:37AM (#26970592)
As an aside, this shows the value and reason behind double entry bookkeeping. More setup in the beginning, but ultimately much less confusing.