{
  "schemaVersion": 1,
  "slug": "back-to-school-calculator",
  "category": "shopping",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "52511c1636eaa18f176c29669552802d5b93b4fc73709f5d297a16fd0603c290",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/back-to-school-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": "T = c × g × B_b + c × B_t + p × c × d",
    "vars": [
      [
        "c",
        "Number of children"
      ],
      [
        "g",
        "Grade-level factor"
      ],
      [
        "B_b",
        "Supplies + clothing + activities budgets"
      ],
      [
        "B_t",
        "Technology budget"
      ],
      [
        "p",
        "Lunch cost per day"
      ],
      [
        "d",
        "School days"
      ],
      [
        "T",
        "Total back-to-school cost"
      ]
    ],
    "note": "g: preschool 0.7, elementary 1, middle 1.15, high 1.35, college 2.2; the technology budget is not multiplied by g."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const supplies=suppliesBudget*children; const clothing=clothingBudget*children; const technology=technologyBudget*children; const activities=activitiesBudget*children; const lunches=lunchPerDay*children*schoolDays; const total=supplies+clothing+technology+activities+lunches; return { supplies, clothing, technology, activities, lunches, total, perChild: total/children };",
    "inputs": [
      {
        "name": "children",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 12,
        "step": 1,
        "slider": true
      },
      {
        "name": "suppliesBudget",
        "type": "number",
        "default": 80,
        "min": 0,
        "max": 5000,
        "step": 5,
        "slider": true
      },
      {
        "name": "clothingBudget",
        "type": "number",
        "default": 250,
        "min": 0,
        "max": 10000,
        "step": 10,
        "slider": true
      },
      {
        "name": "technologyBudget",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 20000,
        "step": 25,
        "slider": true
      },
      {
        "name": "activitiesBudget",
        "type": "number",
        "default": 120,
        "min": 0,
        "max": 20000,
        "step": 10,
        "slider": true
      },
      {
        "name": "lunchPerDay",
        "type": "number",
        "default": 3.5,
        "min": 0,
        "max": 50,
        "step": 0.25,
        "slider": true
      },
      {
        "name": "schoolDays",
        "type": "number",
        "default": 180,
        "min": 0,
        "max": 260,
        "step": 5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "total",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "supplies",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "clothing",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "technology",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "activities",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "lunches",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "perChild",
        "precision": 0,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
