# Need Homework Help if you don't mind.



## hairybusdriver2 (May 29, 2012)

I am having trouble writing this in pseudocode

The book requires me to: input a list of positive numbers (terminated by 0) into an array, find the mean (average) of the numbers in the array,and output the result. Use a subprogram to input numbers, a function to find the mean, and a subprogram to output the result.

What I don't understand is, how do you input numbers into an array, wouldn't they already be declared with a set value?

Any help would be appreciated. Thanks.


----------



## Ent (Apr 11, 2009)

"wouldn't they already be declared with a set value?"

Well, kind of. 5 has a set value. It's always this many:     
Numbers in a variable, however, can change. I presume you'd be comfortable with a variable numberOfSmilies, and you could change that as the program moves on and more faces appear.
An array is literally nothing more than a list of variables stuck together under a single name, so you can alter the values it holds at any point in the program.


----------



## DoubleHelix (Dec 10, 2004)

You must have already covered the topic of how to get input from users. That's how you do it.


----------



## hairybusdriver2 (May 29, 2012)

Yea, I understand it now. Thanks again. I didn't quite understand the question. My problem is I am too lazy at times, to do enough research to figure it out myself. Plus I am super hyper so for me to lock into my books for more than 5 minutes drives me nuts. When I do get through all of my reading I understand it just fine though. A lot of people in my class stopped understanding it after the third week of class, which isn't good. So I am glad I'm at least getting it so far, I just have so much trouble focusing.


----------

