Free mini practice · no registration

Catch the AI bug

The code looks convincing. Does it work? Fix three bugs in a practice calculator and check the result.

All amounts are fictional teaching examples, not school prices. Answers are not sent anywhere and are cleared on reload.
  1. 1Calculate the total
  2. 2Handle keyboard input
  3. 3Check the boundary
01 / 03

Calculate the total

An item costs €8. The total should be price times quantity, including zero.

Original code

total = 8 + quantity
Choose a fix
Hint

Addition and multiplication differ. Try quantities 0 and 5.

Try your own example

Expected
16 (number)
Actual
10 (number)