pillphil wrote: » Your first loop takes input from the user and overwrites the value in temp on each iteration. So when it ends, you have discarded each value apart from the final one. Then you have a second loop which assigns the value of total (i.e 0) to each element of the array TemperatureArray. So by the end of your program, your variables look like this temp == 12 (or whatever the final inputted value was) total == 0 TemperatureArray == {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}(because you assign the value in total to each element of the array. What you want to do is assign the value of temp to the element of the array on each iteration of the loop.
temp=TemperatureArray;
chocolate boy123 wrote: » So I should switch them around ?
Loop through array, assign user input to current index
Loop through array, ?
chocolate boy123 wrote: » Loop through the array counting the numbers imputed
pillphil wrote: » Counting or adding? If every input is 2 what should the total be?
loop through array, store current index in a variable, print that variable to the console
pillphil wrote: » counting will just give you the value 12, which is the length of the array, you don't need a loop to get that value. Forget the "the temperatures are" part for a minute. try and get loop 2 to
chocolate boy123 wrote: » So I only need my first loop?