Tirsvad 8ef00aafaa Add SQA review records and plan MIL-004 Code Review and CI
Add RC-001 to RC-005 for the Business Case, Stakeholder Analysis and
MIL-001 to MIL-003, checked against their QC checklists, and a
traceability matrix. The reviews found a missing duration constraint in
the Business Case; BC-001 v2 adds it, and SA-001 v2 records the
sign-off. Register RC and TM in the artifact registry.

Plan MIL-004 (review the source against QC-PY-001, add a CI workflow)
as Proposed, with Business Case objective 6, a Project Plan gateway
row and a matrix entry. The milestone is not yet synced to the git host.

No issue closed: planning and review documents only, no code changed.
2026-10-06 20:42:51 +08:00
2026-10-04 18:12:54 +02:00

Coffee Machine

A console game from Udemy's 100 Days of Code: The Complete Python Pro Bootcamp (day 15). A virtual coffee machine serves espresso, latte and cappuccino. Pay with US coins (quarters, dimes, nickels and pennies). The machine checks its water, milk and coffee before it serves, refunds you if you pay too little and gives change if you pay too much.

What would you like? (espresso/latte/cappuccino): latte
Please insert coins.
How many quarters?: 10
How many dimes?: 0
How many nickels?: 0
How many pennies?: 0
Here is your latte. Enjoy!
  • Python 3.13 or newer, no runtime dependencies.
  • Type report to see the water, milk, coffee and money in the machine, and off to switch the machine off.
  • The function names follow the assignment: is_resource_sufficient, process_coins, is_transaction_successful, make_coffee.
  • Money is counted in whole cents inside the program, so change is never off by a rounding error.

Requirements

  • Python 3.13 or newer
  • Optional: Doxygen to build the source documentation

Set up

Create a local virtual environment in .venv, activate it, and upgrade pip.

Windows (PowerShell):

python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip

Windows (Git Bash), Linux and macOS:

python -m venv .venv
source .venv/Scripts/activate   # Linux/macOS: source .venv/bin/activate
python -m pip install --upgrade pip

The machine itself needs nothing more. To run the tests and the code checks, install the development tools:

python -m pip install -e ".[dev]"

Run the coffee machine

python -m coffee_machine

Type espresso, latte or cappuccino and press Enter, then enter the coins. Type report for the machine's resources, or off to quit.

Run the tests

python -m pytest

Check the code style and types:

python -m ruff check src tests
python -m ruff format --check src tests
python -m mypy src tests

Build the source documentation

The source uses Doxygen comments. The HTML output goes to docs/doxygen/html.

doxygen Doxyfile

Project layout

Path Content
src/coffee_machine/ The machine: main.py (the loop), constants.py (menu, coins, starting resources)
tests/ pytest tests
docs/ Planning and review documents (business case, plan, milestones)
pyproject.toml Project configuration
Doxyfile Doxygen configuration

License

GNU Affero General Public License v3.0. See LICENSE.

S
Description
Console coffee machine in Python: Day 15 of Udemy's 100 Days of Code bootcamp. Espresso, latte and cappuccino with coins, resources and change. No dependencies.
Readme AGPL-3.0
122 KiB
Languages
Python 100%