I have to write a quiz for my digital tech class using JavaScript. But I don’t know how to show the result that the user got on it.

This is my quiz so far.

1 / 4

Question: “22 x 9”,

answers:

a: “180”,

b: “98”,

c: “109”,

d: "198”

```
Correct Answer: "d"
```

Question: “9 - 11”,

answers:

a: “2”,

b: “-2”,

c: “5”,

d: “3”

```
Correct Answer: "b"
```

Question: “7 x 8”,

answers:

a: “51”,

b: “60”,

c: “56”,

d: “54”

```
Correct Answer: "c"
question: "99 x 9",
answers:
a: "891",
```

2 / 4

b: “900”,

c: “890”,

d: “871”

```
Correct Answer: "a"
question: "100 + 72",
answers:
a: "171",
b: "72",
c: "100",
d: "172"
Correct Answer: "d"
question: "10 x 99",
answers:
a: "999",
b: "900",
c: "990",
d: "1000"
Correct Answer: "c”
```

function mathquiz() {

var qn1 = prompt("[22 x 9] a. 180 b. 98 c. 109 d. 198");

if (qn1 == “d”){

alert(“That is correct!”);

} else {

alert(“That is incorrect!”);

3 / 4

}

var qn2 = prompt("[9 - 11] a. 2 b. -2 c. 5 d. 3 “);

if (qn2 == “b”){

alert(“That is correct!”);

} else {

alert(“That is incorrect!”);

}

var qn3 = prompt(”[7 x 8] a. 51 b. 60 c. 56 d. 54");

if (qn3 == “c”){

alert(“That is correct!”);

} else {

alert(“That is incorrect!”);

}

var qn4 = prompt("[99 x 9] a. 891 b. 900 c. 890 d. 871");

if (qn4 == “a”){

alert(“That is correct!”);

} else {

alert(“That is incorrect!”);

}

var qn5 = prompt("[100 + 72] a. 171 b. 72 c. 100 d. 172");

if (qn5 == “d”){

alert(“That is correct!”);

} else {

alert(“That is incorrect!”);

}

var qn6 = prompt("[10 x 99] a. 999 b. 900 c. 990 d. 100");

if (qn6 == “c”){

alert(“That is correct!”);

} else {

alert(“That is incorrect!”);

}

4 / 4

}

mathquiz()