cout << endl << endl;
cout << "If you want to calculate THE SUM of your numbers," << endl;
cout << "Input 2 and press ENTER." << endl << endl;
cout << "Otherwise, to calculate THE AVERAGE of your numbers," << endl;
cout << "Input 3 and press ENTER." << endl << endl;
cout << "Input your selection here: ";
cin >> Select;
cout << endl;
while (Select < 2 || Select > 3)
{
cout << "Inpute must be 2 or 3." << endl;
cout << "Please re-enter: ";
cin >> Select;
}
if (Select == 2)
cout << "The SUM is: " << SumFx(Input, ArraySize) << endl;
double AvgFx (int Input[ ], int SizeOfArray)
{
int Sum, Y, Avg = 0, Counter = 1;
for(Y = 0; Y < SizeOfArray; Y++)
{
Sum = Sum + Input[Y];
Counter++;
Avg = Sum / Counter;
}
return Avg:
}
If your compiler did not give you an error message that pointed you at that final line, return Avg:, which should be return Avg;, throw it away and get a helpful compiler.
Also, in this function, you are calculating Sum but you did not set it to zero at the start, so it will be some random value. I see that you did fix this in the function SumFx; you will have to set the variable Sum to zero at the start every time you create it inside a function. Doing it in just one function isn't enough.