{
  "address": "251a9263a9fb97bca6572c2fedb04f20",
  "category": "other",
  "question": "A $80 price is discounted by 25%. What is the new price?",
  "answer": "$60.00",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "Your Money, Your Goals: percentage discount and markup conventions",
      "url": "https://www.consumerfinance.gov/consumer-tools/educator-tools/your-money-your-goals/toolkit/"
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "url",
    "value": "https://www.consumerfinance.gov/consumer-tools/educator-tools/your-money-your-goals/toolkit/",
    "retrieved_utc": "2026-09-30T19:31:29Z"
  },
  "qsha256": "dba0a29e5091a52c0f8790fa55577e22da2a753a4e17c8d1ba323d5ee59fd6b2",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Discount and markup",
    "version": "1",
    "source_url_or_file": "methods/discount-and-markup.cjs",
    "sha256_of_method_file": "930d26f3c36600e17119d6076c26cf84f7593f695cca543c1ebea9ff1fdeb185"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "price",
        "type": "number",
        "unit": "currency units",
        "required": true,
        "description": "Original price",
        "min": 0
      },
      {
        "name": "percent",
        "type": "number",
        "unit": "%",
        "required": true,
        "description": "Discount or markup percentage",
        "min": 0
      },
      {
        "name": "mode",
        "type": "string",
        "required": true,
        "description": "Whether to apply a discount or a markup",
        "enum": [
          "discount",
          "markup"
        ]
      }
    ],
    "outputs": [
      {
        "name": "new_price",
        "unit": "currency units",
        "description": "Price after the discount or markup"
      },
      {
        "name": "amount_change",
        "unit": "currency units",
        "description": "Dollar amount of the discount or markup"
      }
    ],
    "steps": [
      "Convert the percent to a decimal: p = percent / 100.",
      "amount_change = price * p.",
      "If mode is discount, new_price = price - amount_change; if mode is markup, new_price = price + amount_change.",
      "Round new_price and amount_change to 2 decimals (money to cents)."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "price": 80,
          "percent": 25,
          "mode": "discount"
        },
        "expected": {
          "answer": "$60.00"
        },
        "check": "hand computation: amount_change = 80*0.25 = 20.00; new_price = 80-20 = 60.00"
      },
      {
        "name": "test vector: markup",
        "inputs": {
          "price": 150,
          "percent": 40,
          "mode": "markup"
        },
        "expected": {
          "answer": "$210.00"
        },
        "check": "hand computation: amount_change = 150*0.40 = 60.00; new_price = 150+60 = 210.00"
      }
    ],
    "disclaimer": null,
    "deck_category": "finance"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "url",
          "value": "https://www.consumerfinance.gov/consumer-tools/educator-tools/your-money-your-goals/toolkit/",
          "retrieved_utc": "2026-09-30T19:31:29Z"
        },
        "sha256": "f20ccbfd92293c2cd1bcd38eb23abfb7b1852e213e186f5eefd94dc47efa37df",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Discount and markup",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
