2. Write a program in Java to accept the maximum and minimum temperature of each day of a week and store them in two different arrays. Calculate the average temperature of the week along with highest and lowest average temperature of the week. Display the results with proper message.
Answers
Answered by
2
Answer:
Addressing each issue on it's own:
"incompatible types: int[] cannot be converted to int" issue
This is being caused by the line System.out.print(weekDay(tempList,maxTemp));. The method signature for the weekDay method is public static String weekDay(int i, int[] array) however the method is being called with arguments in the wrong order - tempList is of type int[] and maxTemp is of type int. Reversing the arguments in either the method call or the method signature will resolve the error.
Similar questions