Files
marqdo/tests/blind/tasks/vendor_po_gate.md
T
cflmy 9331af78e2 release(2.8.0): 合入 CHANGELOG/README/发版说明/skills prove 任务;CI 链接指向 doc/releases
- CHANGELOG.md:v2.8.0 条目(中英双语);
- README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明);
- doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制);
- skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/
  require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过);
- 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
2026-11-18 10:29:26 +08:00

1.5 KiB
Executable File

Task: vendor_po_gate (complex procurement business policy)

Implement a vendor purchase-order payable gate for an enterprise procurement desk. This is a business-policy task (multi-rule approval economics), not an algorithms puzzle. Use integer arithmetic only. Hardcode the demo inputs below and print one integer: the final payable.

Business requirements (authoritative)

  1. Base line: base = qty * unit_cost.
  2. Preferred-vendor discount: if vendor_tier >= 2 (tier-2+ preferred suppliers), set amount = base * 97 / 100; otherwise amount = base.
  3. Rush surcharge: if urgency == 1, set amount = amount + amount * 5 / 100; otherwise keep amount.
  4. Budget clamp: if amount > budget_cap, set amount = budget_cap.
  5. Compliance fee: if risk_flag == 1, fee = 80; else fee = 0.
  6. Payable floor: payable = amount + fee; if payable < 200 then payable = 200.

Demo inputs (hardcode)

  • qty = 20
  • unit_cost = 40
  • vendor_tier = 2
  • urgency = 1
  • budget_cap = 900
  • risk_flag = 0

Requirements

  • Provide named helpers (or clear stages) for discount, rush, budget clamp, fee, and assemble — not one opaque expression.
  • Print only the final integer (no labels).
  • Align the program to the business requirements above; do not invent alternate thresholds.

Expected output (self-check)

Exactly one line: 814

Deliverable

Write the program as a Marqdo .mq.md file. Return the complete source in a single ```markdown fence — no prose outside the fence.