Hi everyone, I need a bit of help in this assignment I need to hand in for university. Can anyone help me? here is the problem:-
"Read a program that will read in a file of integers into an array. Hence, writing your own functions, compute their mean, the largest value, and a function count to count how many times an integer occurs int he data. Output your results to a file aswell as the screen."
*Apparently these arays must also be read from a text file*
If anyone has any ideas I will be very greatful for your comments and help.
I know that something like this should be in it (I wrote most of this down, my lecturer edited it for me), but can anyone by any chance give me the codes to help complete this assignment.
I have declared also where I am also confused, imk not even sure what variable 'Size' is.
using namespace std;
float mean(float A, int Size);
int last, i;
for (i=0; i < 99; i++) // i = i + 1 is the same as i++
mean(myArray, i) // what variable is "Size"?
for (i=0; i <= last; i++)
cout << X[i] << " "; // don't quote around variables
} //end loop
float mean (float A, int Size) // what variable is Size?
float sum = 0;
for (int i=0; i < Size; i++) // wrong semi-colon,
sum = sum + A[i];
m = sum/Size;
THANKS AND KIND REGARDS