tnbrwneyez
Programmer
I need to take the following script and prompt the user for the number of random numbers to generate. I also need to make the random number script run three times, calculating a total of 15,000 randon numbers and display separae total for each set of 5,000.
<html>
<head><title>Math Example</title>
</head>
<body>
<h1>Math Example</h1>
<script LANGUAGE="JavaScript" type="text/javascript">
total = 0;
for (i-1; i<=5000; i++){
num=Math.random();
total +=num;
window.status = "Generated" + i + " numbers. ";
}
average = total / 5000;
average=Math.round(average * 1000) / 1000;
document.write("<H2>Average of 5000 numbers: " + average + "</H2>");
</script>
</body>
</html>
I appreciate any help!
Thanks
Tammie
<html>
<head><title>Math Example</title>
</head>
<body>
<h1>Math Example</h1>
<script LANGUAGE="JavaScript" type="text/javascript">
total = 0;
for (i-1; i<=5000; i++){
num=Math.random();
total +=num;
window.status = "Generated" + i + " numbers. ";
}
average = total / 5000;
average=Math.round(average * 1000) / 1000;
document.write("<H2>Average of 5000 numbers: " + average + "</H2>");
</script>
</body>
</html>
I appreciate any help!
Thanks
Tammie