{
  "format": "tokbit",
  "version": 1,
  "name": "Circle with diameter",
  "main": [
    {
      "id": "u1",
      "kind": "declare",
      "name": "r",
      "type": "float"
    },
    {
      "id": "u2",
      "kind": "doWhile",
      "body": [
        {
          "id": "u3",
          "kind": "input",
          "target": "r",
          "prompt": "Radius of the circle:"
        },
        {
          "id": "u4",
          "kind": "if",
          "condition": "r <= 0",
          "then": [
            {
              "id": "u5",
              "kind": "output",
              "values": "\"The size must be greater than 0.\""
            }
          ],
          "else": []
        }
      ],
      "condition": "r <= 0",
      "comment": "Asks again until the size is positive."
    },
    {
      "id": "u6",
      "kind": "output",
      "values": "\"Diameter:\", 2 * r"
    },
    {
      "id": "u7",
      "kind": "output",
      "values": "\"Circumference:\", round(2 * pi * r, 2)",
      "comment": "Circumference: C = 2 · π · r."
    },
    {
      "id": "u8",
      "kind": "output",
      "values": "\"Area:\", round(pi * r ** 2, 2)",
      "comment": "Area: A = π · r², r ** 2 is r squared."
    }
  ],
  "functions": [],
  "comment": "Solution to the task “Diameter and a negative radius”: Also print the diameter d = 2 · r. Try a negative radius: what does the program do and why?",
  "screen": "fit"
}
