So this program calculates bonus rates for multiple sales persons depending on how much they bring in. I then have to output the total bonus paid, the average bonus paid, and the largest bonus paid. I have everything working up till I have to output the largest bonus paid. I'm not sure how to go about this at all. I've been told to compare the input each time the for loop repeats, but I don't know how to do that.
int max = array[0]; // start with max = first element
for(int i = 1; i<length; i++)//length is array size
{
if(array[i] > max)
max = array[i];//highest value in array
}
int, double, whatever flavor you need same boilerplate.