Click to See Complete Forum and Search --> : Collecting Temperatures


snowball
12-07-2002, 12:22 PM
Brand new to Javascript and am still trying to get to grips with the basics.

I am currently trying to do an average temperature calculator... Pretty simple to you guys, but a project that I am finding a bit tricky...

Without using arrays, how do I store 31 temperatures for december?

Do I have to use 31 Variables? such as

var dec1
var dec2 etc etc

then have a prompt box loop, entering fields into each variable...

What if I wanted to log temps for the whole year, does that mean 365variables :confused:

aarrgghh, after sitting here most of Friday day and all of today I am having an absoloute mare on this...

Anyone offer any help :confused:

Many thanks

Paul

snowball
12-07-2002, 12:42 PM
Hi Dave,

Just that I am following an order given to me by a tutor... I have to do loads of stuff (such as: Number of days temp is below freezing, above 20 degrees etc.), but as we have not yet covered them I can't use arrays.

I have found some good websites such as w3schools.com and have got some good books - "Beginning Javascript by Paul Wilson", Javascript is Easy steps and loads more, but none explain how to trap a number of values using variables! This is a pain as I'm unsure as to whether I now need 365 variables... :confused:

I am a beginner, so please forgive the lack of terms etc in post.

Cheers

Paul

snowball
12-07-2002, 12:57 PM
Thanks very much... Highly appreciated
:p