It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Assignment HELP due tommorow

Assignment HELP due tommorow

Postby dpelaez on Wed Mar 17, 2010 8:47 pm

I NEED HELP!!! Here are the directions to my assignment...any help would be appreciated...
Prompt user with a dialog box asking how many questions they would like on there multiplication quiz, then computer must generate the amount of questions with random multiplication of 0-12... Then I must print a message indicating what the problems given, the answer given and if they were correct or incorrect and Incorrect ones need to have the correct answer displayed. HELP! PLEASE!

Here it is...

<script language="javascript">
//Number of questions
var num = parseFloat(prompt("How many questions would you like on your quiz today?"));

//Function multiply two random numbers
function mulQuiz(i)
{
var result= (i);
return("Problem " + i + " : " + " &nbsp;&times&nbsp " + "Your answer: " + q + "&nbsp;&nbsp;" + result + "<br>");
}
//Math random
var q = parseFloat(prompt("What is " + Math.floor(Math.random()*13) + " x " + Math.floor(Math.random()*13) + " ? "));

document.write(Math.floor(Math.random()*13));

//result of answer
if (q == i)
{
document.write("<b>Correct!</b>");
}
else
{
document.write("Incorrect: The correct answer is " + i);
}
</script>
dpelaez
 
Posts: 1
Joined: Wed Mar 17, 2010 8:36 pm

Who is online

Users browsing this forum: No registered users and 3 guests