{
    "path": "/home/krm/dev/mimer-academia/programing/js/introduction/Questions/if.sv.json",
    "s": "Ignor",
    "invert": true,
    "level": 1,
    "title": [
        "If-satser"
    ],
    "status": "alpha",
    "author": [
        "krm"
    ],
    "created": {
        "year": 2022,
        "month": 10,
        "day": 13
    },
    "description": [],
    "statments": [
        {
            "description": [
                "Om ett värde efterfrågas på en variabel är det alltid efter koden har körs som avsets."
            ]
        }
    ],
    "comment": [],
    "cards": [
        {
            "level": 1,
            "index": 1,
            "title": [
                "Varför har vi if-satser?"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "Endast för att skpa motsägelser."
                    ]
                },
                {
                    "description": [
                        "Endast för det är kul."
                    ]
                },
                {
                    "right": true,
                    "description": [
                        "För att kunna göra val i vår kod."
                    ]
                },
                {
                    "description": [
                        "För får vår kod att gå snabbare."
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 2,
            "title": [
                "Hur skulle du översätta \"else if\" till svenska?"
            ],
            "description": [],
            "statments": [
                {
                    "right": true,
                    "description": [
                        "annars om"
                    ]
                },
                {
                    "description": [
                        "alltid om"
                    ]
                },
                {
                    "description": [
                        "annars slut"
                    ]
                },
                {
                    "description": [
                        "alltid slut"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 3,
            "title": [
                "Beskriv något konkret du kan använda if-satser till."
            ],
            "description": [],
            "statments": [
                {
                    "right": true,
                    "description": [
                        "välja vad som ska göras"
                    ]
                },
                {
                    "description": [
                        "ingentign"
                    ]
                },
                {
                    "description": [
                        "i huvudsak till att skapa loopar"
                    ]
                },
                {
                    "description": [
                        "kommentera bort kod"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 4,
            "title": [
                "Ge ett exempel på början av en enkel vilkorsatser?"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "for(true) {"
                    ]
                },
                {
                    "description": [
                        "while(true) {"
                    ]
                },
                {
                    "description": [
                        "switch(answer) {"
                    ]
                },
                {
                    "right": true,
                    "description": [
                        "if(answer === true) {"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 5,
            "exactly": true,
            "title": [
                "Vad är värdet på *flip* variabeln nedan?"
            ],
            "description": [],
            "lang": "js",
            "code": "let flip = true;\nif(true) {\n\tflip = false\n}",
            "statments": [
                {
                    "description": [
                        "false"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 6,
            "exactly": true,
            "title": [
                "Vad är värdet på *flip* variabeln nedan?"
            ],
            "description": [],
            "lang": "js",
            "code": "let flip = false;\nif(flip) {\n\tflip = false\n} else {\n\tflip = true;\n}",
            "statments": [
                {
                    "description": [
                        "true"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 7,
            "exactly": true,
            "title": [
                "Om en användare skriver in \"j\" vad skriver programmet ut?"
            ],
            "description": [],
            "lang": "js",
            "code": "let answer = prompt(\"Vill du ha kaffe?\");\nif(answer === \"j\") {\n\tconsole.log(\"Kaffe kommer.\");\n} else {\n\tconsole.log(\"Du får inte sova på lektionen!\");\n}",
            "statments": [
                {
                    "description": [
                        "Kaffe kommer."
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 8,
            "exactly": true,
            "title": [
                "Om en användare skriver in \"j\", \"ja\" och \"neeeej\", vad skriver programmet ut?"
            ],
            "description": [],
            "lang": "js",
            "code": "let answer = prompt(\"Vill du ha te?\");\nif(answer === \"j\" || \"ja\") {\n\tconsole.log(\"Te Time\");\n} else {\n\tconsole.log(\"London Bridge Is Falling Down\");\n}",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "exactly": true,
                    "title": [
                        "Test"
                    ],
                    "description": [],
                    "lang": "sh",
                    "code": "> j\nTe Tim\n> ja\nTe Tim\n> neeeej\nLondon Bridge Is Falling Down",
                    "statments": [],
                    "comment": []
                }
            ],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 9,
            "exactly": true,
            "title": [
                "Vad skriver programmet ut om en användare skriver \"b\", \"r\" eller \"g\""
            ],
            "description": [],
            "lang": "js",
            "code": "let answer = prompt(\"Ge mig en förkortning?\");\nif(answer === \"b\") {\n\tconsole.log(\"blå\");\n} else if(answer === \"r\")\n\tconsole.log(\"röd\");\n} else if(answer === \"g\")\n\tconsole.log(\"gult\");\n} else {\n\tconsole.log(\"Okänd förkortning.\");\n}",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "right": true,
                    "title": [
                        "Test"
                    ],
                    "description": [],
                    "lang": "test",
                    "code": "? b\nblå\n? r\nröd\n? g\ngult",
                    "statments": [],
                    "comment": []
                }
            ],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 10,
            "exactly": true,
            "title": [
                "En användare skriver in \"+\",\"1\", \"1\", vad skriv ut? Testa också  \"*\",\"-2\", \"-2\" samt  \"/\",\"0\", \"10\"."
            ],
            "description": [],
            "lang": "js",
            "code": "let select = prompt(\"Välj operator?\");\nlet A = Number(prompt(\"Ge första talet?\"));\nlet B = Number(prompt(\"Ge andra talet?\"));\nlet result;\nif(select === \"+\") {\n\tresult = A + B;\n} else if(select === \"-\")  {\n\tresult = A - B;\n} else if(select === \"*\")  {\n\tresult = A * B;\n} else if(select === \"/\")  {\n\tresult = A / B;\n} else {\nresult = \"Kan inte beräkna det!\"\n}\nconsole.log(result);",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "right": true,
                    "title": [
                        "Test"
                    ],
                    "description": [],
                    "lang": "test",
                    "code": "? +\n? 1\n? 1\n2\n? *\n? -2\n? -2\n4\n? /\n? 0\n? 10\n0",
                    "statments": [],
                    "comment": []
                }
            ],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 13,
            "exactly": true,
            "title": [
                "Om en användare skriver in två \"j\" vad skriver programmet ut? Om användaren skriver in något annat."
            ],
            "description": [],
            "lang": "js",
            "code": "let answer_A = prompt(\"Har vi ett A?\");\nlet answer_B = prompt(\"Har vi ett B?\");\nif(answer === \"j\") {\n\tif(answer === \"j\") {\nconsole.log(\"Vi har både A och B.\");\n\t}\n}\nconsole.log(\"The End\");",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "right": true,
                    "title": [
                        "Test"
                    ],
                    "description": [],
                    "lang": "test",
                    "code": "? j\n? j\nVi har både A och B.\nThe End\n? nä\n? bu\nThe End",
                    "statments": [],
                    "comment": []
                }
            ],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 14,
            "exactly": true,
            "title": [
                "Testa alla olika alternativ. Vad skrivs ut?"
            ],
            "description": [],
            "lang": "js",
            "code": "let answer = prompt(\"En hatt?\");\nlet answer = prompt(\"Vit eller svart?\");\nif(answer === \"j\") {\nif(answer === \"v\") {\nconsole.log(\"En vit hatt\");\n} else if(answer === \"s\") {\n\tconsole.log(\"En Svart hatt\");\n}\n} else {\nconsole.log(\"Hemligt\")\n}",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "right": true,
                    "title": [
                        "Test"
                    ],
                    "description": [],
                    "lang": "test",
                    "code": "? j\n? v\nEn vit hatt\n? j\n? s\nEn svart hatt\n? mössa\n? grå\nHemligt",
                    "statments": [],
                    "comment": []
                }
            ],
            "kind": "question"
        }
    ],
    "kind": "questions"
}