Hi
Iam new here and new to javescript
ok my problem is i have to try and find out the average of some plant (don't ask )
i have tried everything but still no good, i am sur eit is simple but i am blond
anyways here is what i have done so far any help would be great
thanks for taking the time to read my problem and i hope someone can help.Code:<HTML> <HEAD> <TITLE> Plant Experiments </TITLE> <SCRIPT LANGUAGE = "JavaScript"> /* * Program to calculate average height of plants.. * * 20/05/2009 */ //Experimental results of Table 1 stored in arrays. var plantHeights = [15,16,17,18,19]; var plantNumbers = [2,1,6,4,2]; //Part (ii). //Write code to declare and initialise new array to represent the third row of the table. var avg = new Array(5) var avg = ["60","80","187","180","114"] ; avg[0] = "60"; avg[1] = "80"; avg[2] = "187"; avg[3] = "180"; avg[4] = "114"; //Part (iv). //Write code to calculate the average height of the plants and write it out in the browser window. Average = avg.length document.write ("The Average height is: " + Average + "<br>") </SCRIPT> </HEAD> <BODY> </BODY> </HTML>
love
kelly





Reply With Quote
can shed some light on it i would be most greatful.

but i am 32 and thick when it comes to javascript
and it is the only bit of javascript in the course (phew)

Bookmarks