Please help!
Create a web application in HTML & JavaScript that contains an updated "math quiz". Include the following:
//SAVE THE CODE AS filename.html
<!DOCTYPE html>
<html>
<head>
<title>Math Quiz</title>
</head>
<style type="text/css">
body {
}
</style>
<script type="text/javascript">
// Function is called when the
page loads or refreshed
function mathQuiz() {
// Array of Questions
Declared
var qnArray = [
"What is
1+2?",
"What is
5*7",
"What is
10/5",
"What is
1+2+6?",
"What is
9-5?",
"What is
1+7-2?",
"What is
4*4?"
];
// Random Question is selected
and stored in randomQn variable
var randomQn =
qnArray[Math.floor(Math.random()*qnArray.length)];
// Answer Entered by User is
stored in enteredAns variable
var enteredAns =
prompt(randomQn);
// Checks if the Entered answer
is Number or not
if(!isNaN(enteredAns)) {
// if random
Question Selected matches with this one, then is true
if(randomQn ===
"What is 1+2?" ) {
// If Question matches, then checks for
answer
// if answer is right the Shows right Answer
else shows Wrong Answer
// All the Below conditions are checked one by
one
if(enteredAns === "3" ) {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
if(randomQn
=== "What is 5*7") {
if(enteredAns === "35") {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
if(randomQn
=== "What is 10/5") {
if(enteredAns === "2" ) {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
if(randomQn ===
"What is 1+2+6?") {
if(enteredAns === "9" ) {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
if(randomQn ===
"What is 9-5?") {
if(enteredAns === "4" ) {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
if(randomQn ===
"What is 1+7-2?") {
if(enteredAns === "6" ) {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
if(randomQn ===
"What is 4*4?") {
if(enteredAns === "16" ) {
alert("Right Answer");
}
else {
alert("Wrong Answer");
}
}
}
else {
alert("Enter
Numbers only");
}
}
</script>
<body onload="mathQuiz()">
<br> <center>
<h1>Refresh Page to get Question</h1>
</center>
</body>
</html>
SCREENSHOTS:









Please help! Create a web application in HTML & JavaScript that contains an updated "math quiz"....