View Full Version : Need some help with the last part of this program.
the noise
11-01-2005, 01:07 PM
Hello, i am new to using Alice, just really started programming in this other than that i have had a little bit of VisualBasic. Anyway I don't know i this is the right place ot post but onto the qustion. I am working on a program in alice that converts temperatures from fahrenheit to celsius and does other stuff when the temperatures are at a certain degree. The last step to the project is I have to have all the temperatures average in both degrees celsius and degrees fahrenheit and then tell how far the maximum and minimum temperatures inputted are from the average. If any of you could take a look at it and help me out, i would greatly appreciate it. Thanks in advance.
have you learned about lists yet?
the noise
11-01-2005, 01:45 PM
no, i tried messing around with that and i e-mailed my teacher about it and told her i tried to do it with lists but i couldnt figure it out, she said it could be done with a variable initialized to zero to keep track of it, but honestly i have no idea what to do with that :(
So, you'll want three separate variables.
One will be to keep a sum of all the temperatures. To do this, every time the user inputs another temperature, you'll want the variable to be equal to itself plus the new temperature. From there, you can find the average temperature in C and F.
The other two variables will keep track of the lowest temperature and the highest temperature that the user inputs. You'll want to set both of them to the first temperature, and subsequent time the user inputs another temperature, check to see if it's lower than the lowest; if so, make it the new low variable value. If it is not lower than the lowest, check if it's higher than the highest, etc.
Take it from there! :)
the noise
11-01-2005, 02:14 PM
thanks