need help with a project I am working on to help a former teacher....
she needs to use java to make a program using array of scores to calculate a average:
requirements: function must be called scores ; must have at least 6 scores ; will need a variable to hold the sum of the scores ; have a loop that will go through the array and add up the total of all scores in array ; then calculate the average and only display that to the screen
does anyone have any ideas? i have never done a program like this but am wanting to help her if I can.
This is what I have so far...no idea if its anyway correct
<body>
<p> Average: <span id="output"></span></p>
<script type="text/javascript">
var scores [];
function addScores() {
'use strict' ;
var scores = document.getElementById('scores');
var output = document.getElementById('output').value=scores[i];
// End of scores() function.
window.onload = scores;
</script>