MIL-002: coffee machine core #21

Merged
Tirsvad merged 1 commits from mil-002-coffee-machine-core into main 2026-10-06 13:52:18 +02:00
Owner

Implements the coffee machine: constants (menu, coins, starting resources, messages), report, is_resource_sufficient, process_coins, is_transaction_successful, make_coffee and the main loop. Money is counted in whole cents.

Checked with ruff, mypy --strict, pytest and doxygen, plus a scripted session covering report, refusal on low resources, refund, change, profit, unknown input and off.

Notes for the reviewer:

  • The report prints $2.50 where the assignment prints $2.5.
  • process_coins re-asks on non-numeric or negative coin counts (not in the assignment).
  • tests/test_smoke.py now feeds off so the loop exits; the real tests come in MIL-003.

Closes #6
Closes #7
Closes #8
Closes #9
Closes #10
Closes #11
Closes #12

Implements the coffee machine: constants (menu, coins, starting resources, messages), report, is_resource_sufficient, process_coins, is_transaction_successful, make_coffee and the main loop. Money is counted in whole cents. Checked with ruff, mypy --strict, pytest and doxygen, plus a scripted session covering report, refusal on low resources, refund, change, profit, unknown input and off. Notes for the reviewer: - The report prints `$2.50` where the assignment prints `$2.5`. - process_coins re-asks on non-numeric or negative coin counts (not in the assignment). - tests/test_smoke.py now feeds `off` so the loop exits; the real tests come in MIL-003. Closes #6 Closes #7 Closes #8 Closes #9 Closes #10 Closes #11 Closes #12
Tirsvad added 1 commit 2026-10-06 13:51:54 +02:00
Add the menu, coin values, starting resources and message texts to
constants.py. Implement report, is_resource_sufficient, process_coins,
is_transaction_successful, make_coffee and the main loop. Money is
counted in whole cents. The smoke test now feeds "off" so the loop
exits.

Closes #6
Closes #7
Closes #8
Closes #9
Closes #10
Closes #11
Closes #12

Task: MIL-002#1
Task: MIL-002#2
Task: MIL-002#3
Task: MIL-002#4
Task: MIL-002#5
Task: MIL-002#6
Task: MIL-002#7
Tirsvad merged commit 9b5eff7163 into main 2026-10-06 13:52:18 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100-days-of-code/015-coffee-machine#21