DebugJuniorBackendAuto-graded
Fix invoice totals that drift by a cent
Knowing why computers mishandle money, and making every billed amount exact to the penny, is all this asks.The billing module totals invoices — line totals, a percentage tax, a flat discount — and it works until finance notices the numbers are a cent out. A three-pack of ten-cent items reports a fraction over thirty cents, a line at $2.045 rounds the wrong way, and a 120-line invoice lands a penny short of the hand total. The cause is the oldest bug in money software: the arithmetic runs in floating point, which cannot hold most decimal cents exactly, so the errors drift and accumulate.25 min
python
What it measures
PythonUsing exact decimal types correctly, including where values enter and leave the calculation.
Debugging and profilingTracing a one-cent discrepancy back to representation rather than to the visible arithmetic.
Care with moneyTreating rounding policy and accumulation order as part of correctness, because in billing they are.
Your environment
Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards
Start this lab
25 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo