tnbrwneyez
Programmer
I need to take the following code and create a variable named num and assign its value a random integer between 0 and 9> I need to use the Math object's round ()and random () methods in tandem to accomplish this task. The random number must be multiplied by 9. I need to use the round () method to round that number to the nearest integer.
<SCRIPT LANGUAGE="JavaScript">
<!--
// Make sure these quotes don't wrap in your file
var quotes = new Array()
quotes[0] = "Every time history repeats itself the price goes up.<BR><small><i>- Anonymous</i></small>"
quotes[1] = "The moment you think you understand a great work of art, it's dead for you.<BR><small><i>- Robert Wilson</small></i>"
quotes[2] = "To love one person with a private love is poor and miserable; to love all is glorious.<BR><small><i>- Thomas Traherne</small></i>"
quotes[3] = "Every violation of truth is not only a sort of suicide in the liar, but is a stab at the health of human society.<BR><small><i>- Ralph Waldo Emerson</i></small>"
quotes[4] = "Man is to be found in reason, God in the passions.<BR><small><i>- G. C. Lichtenberg</i></small>"
quotes[5] = "Great innovations should not be forced on slender majorities.<BR><small><i>- Thomas Jefferson</i></small>"
quotes[6] = "In this world nothing can be said to be certain, except death and taxes.<BR><small><i>- Benjamin Franklin</i></small>"
quotes[7] = "Nine-tenths of wisdom consists in being wise in time.<BR><small><i>- Theodore Roosevelt</i></small>"
quotes[8] = "We have no more right to consume happiness without producing it than to consume wealth without producing it.<BR><small><i>- George Bernard Shaw</i></small>"
quotes[9] = "So little done, so much to do.<BR><small><i>- Cecil Rhodes</i></small>"
// Use Math object
// -->
</SCRIPT>
I appreciate any help!!
Thanks
<SCRIPT LANGUAGE="JavaScript">
<!--
// Make sure these quotes don't wrap in your file
var quotes = new Array()
quotes[0] = "Every time history repeats itself the price goes up.<BR><small><i>- Anonymous</i></small>"
quotes[1] = "The moment you think you understand a great work of art, it's dead for you.<BR><small><i>- Robert Wilson</small></i>"
quotes[2] = "To love one person with a private love is poor and miserable; to love all is glorious.<BR><small><i>- Thomas Traherne</small></i>"
quotes[3] = "Every violation of truth is not only a sort of suicide in the liar, but is a stab at the health of human society.<BR><small><i>- Ralph Waldo Emerson</i></small>"
quotes[4] = "Man is to be found in reason, God in the passions.<BR><small><i>- G. C. Lichtenberg</i></small>"
quotes[5] = "Great innovations should not be forced on slender majorities.<BR><small><i>- Thomas Jefferson</i></small>"
quotes[6] = "In this world nothing can be said to be certain, except death and taxes.<BR><small><i>- Benjamin Franklin</i></small>"
quotes[7] = "Nine-tenths of wisdom consists in being wise in time.<BR><small><i>- Theodore Roosevelt</i></small>"
quotes[8] = "We have no more right to consume happiness without producing it than to consume wealth without producing it.<BR><small><i>- George Bernard Shaw</i></small>"
quotes[9] = "So little done, so much to do.<BR><small><i>- Cecil Rhodes</i></small>"
// Use Math object
// -->
</SCRIPT>
I appreciate any help!!
Thanks