# Dict Mini Project — Tip Calculator
# service rated, tip looked up, total calculated
# redhorndev.com

# ─────────────────────────────────────────────
# Setup — tip percentages stored in a dict
# ─────────────────────────────────────────────

tips = {
    "poor":      0.10,      # 10%
    "good":      0.15,      # 15%
    "excellent": 0.20       # 20%
}

# ─────────────────────────────────────────────
# Input
# ─────────────────────────────────────────────

bill = float(input("Bill amount: $"))
rating = input("Service (poor / good / excellent): ").lower()

# ─────────────────────────────────────────────
# Lookup and calculate
# ─────────────────────────────────────────────

if rating in tips:
    percentage = tips[rating]
    tip = bill * percentage
    total = bill + tip
    print(f"\nTip ({int(percentage * 100)}%):   ${tip:.2f}")
    print(f"Total:       ${total:.2f}")
else:
    print("Invalid rating. Choose: poor, good, or excellent.")
