So I have to create a function that will average the numbers inputted by the user in an array which can go up to 10 numbers, but could be stopped anywhere between the first input and the tenth by the user inputting -1
i'm unsure whether its similar to finding the highest number which i've done
What I have going right now is but I have no clue on how to get it to average the numbers since its not going to be divided by a set number
cout << "The average of the results = " << calc_average(score) << "\n";
cout << "The lowest of the results = " << find_lowest(score) << "\n";
system("Pause");
}
double calc_average(double a[])
{
}
double find_highest(double a[])
{
double temp = 0;
for(int i=0;i<10;i++)
{
if(a[i]>temp)
temp=a[i];
}
return temp;
}
EDIT: To clarify, the max number is results a user can enter is 10 thats why it goes up to 10.