computeHighestMonth(monthlySales)
This method receives the monthly sales array as an argument. This method will search and compare the values of the monthly sales array for the highest value. The method will return the index (or location in the array) of the month with the highest value.
I had it so that it would display the highest sales, but I can't figure out how to include the month name.
public static double computeHighestMonth(double[] monthlySales)
{
double highestSales = 0;
for (int index = 0; index < monthlySales.length; index++)
{
if (monthlySales[index] > highestSales)
highestSales = monthlySales[index];
}
return highestSales;
}