{
  "schemaVersion": 1,
  "slug": "quit-smoking-savings-calculator",
  "category": "household",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "0c6650ab8ff42a975f13961380816c10595af1a4fa36abc3a7d4199007bca363",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/quit-smoking-savings-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "C_year = (cigarettes/day ÷ cigarettes/pack) × pack price × 365; savingsₙ = C_year × n",
    "vars": [
      [
        "N",
        "Cigarettes per day"
      ],
      [
        "n",
        "Cigarettes per pack"
      ],
      [
        "p",
        "Price per pack"
      ],
      [
        "t",
        "Years smoked"
      ],
      [
        "C",
        "Annual cost"
      ],
      [
        "L",
        "Life years regained"
      ],
      [
        "k",
        "Constant bonus (years)"
      ]
    ],
    "note": "Financial estimate only, holding today’s pack price constant; no life-expectancy estimate."
  },
  "externalEvidence": {
    "reviewedAt": "2026-09-26",
    "sources": [
      {
        "name": "CDC — Benefits of Quitting Smoking",
        "url": "https://www.cdc.gov/tobacco/about/benefits-of-quitting.html"
      }
    ]
  },
  "contract": {
    "compute": "const packsPerDay=cigsPerDay/cigsPerPack,dailyCost=packsPerDay*pricePerPack,yearly=dailyCost*365; return {dailyCost,yearlyCost:yearly,saved5:yearly*5,saved10:yearly*10};",
    "inputs": [
      {
        "name": "cigsPerDay",
        "type": "number",
        "default": 20,
        "min": 1,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "pricePerPack",
        "type": "number",
        "default": 8,
        "min": 0.5,
        "max": 50,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "cigsPerPack",
        "type": "number",
        "default": 20,
        "min": 10,
        "max": 40,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "dailyCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "yearlyCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "saved5",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "saved10",
        "precision": 0,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
