I am writing 2 functions for a group project program. They are very simple but I was sick during class when we talked about arrays so i'm looking for someone who wouldnt mind taking a little time to help me figure them out. All help would be greatly appreciated. I will be on my computer all day/night so my replies will be very quick..
//You need 5 variables of the same type:
int var1=1, var2=2, var3=3, var4=4, var5=5;
//You want to type less and have things much easier
int array[5] = {1,2,3,4,5};
//notice that the first element of the array would be array[0]
The first function is to take 2 arrays that's size is 6 and average them into a 3rd array.
one array is called midterm [76,92,65,71,90,88]
2nd array is called final [81,87,69,71,95,74]
and the 3rd would be mean [78.5,89.5,67.0,71.0,92.5,81.0]
Well, I won't give the answer away because this sounds like a classic case of making an excuse to get the answer to your homework. Simply put, you need to iterate through array 1 and 2 using a loop and the same variable. arrayone[i] and arraytwo[i] are accessed at element i. In that, you can average those to members by adding them and dividing them by two.
i dont want the answer..Just wanted a little help getting started..Having someone do it for me defeats the purpose of me wanting to learn how to do it..
But is the "if/else if" stuff right? Because thats what we have learned so far..Havent learned "assert" or the "ffffffdcbaa" even though i see how it works better..