Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IN JAVA PLEASEE Write a program that uses a TWO-dimensional array to store the h

ID: 3538296 • Letter: I

Question

IN JAVA PLEASEE Write a program that uses a TWO-dimensional array to store the highest and lowest temperatures for each month of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of the following methods:

a. Method getData: This method reads and stores the data in the two-dimensional array.

b. Method averageHigh: This method calculates and returns the average high temperature of the year.

c. Method averageLow: This method calculates and returns the average low temperature of the year.

d. Method indexHighTemp: This method returns the index of the highest temperature in the array.

e. Method indexLowTemp: This method returns the index of the lowest temperature in the array.

(These methods must all have the appropriate parameters.)


USE THE FOLLOWING INPUT:

HIGH TEMPERATURE FOR EACH MONTH: 30 40 45 60 70 90 89 95 79 90 70 40

LOW TEMPERATURE FOR EACH MONTH: 10 -10 20 30 50 75 85 79 50 80 30 20

Explanation / Answer

Sample output



Enter your choice

Press 1 to enter data

Press 2 to get highest temperature

Press 3 to get lowest temperature

Press 4 to get highest average

Press 5 to get lowest average

Press 6 to exit

1

Enter low temperatures first

10

-10

20

30

50

75

85

79

50

80

30

20

Now You enter all the high temperatures

30

40

45

60

70

90

89

95

79

90

70

40

Now You enter all the high temperatures

Enter your choice

Press 1 to enter data

Press 2 to get highest temperature

Press 3 to get lowest temperature

Press 4 to get highest average

Press 5 to get lowest average

Press 6 to exit

2

Highest temperature is : 95

Enter your choice

Press 1 to enter data

Press 2 to get highest temperature

Press 3 to get lowest temperature

Press 4 to get highest average

Press 5 to get lowest average

Press 6 to exit

3

Lowest temperature is : -10

Enter your choice

Press 1 to enter data

Press 2 to get highest temperature

Press 3 to get lowest temperature

Press 4 to get highest average

Press 5 to get lowest average

Press 6 to exit

4

Highest average is : 66.5

Lowest average is : 43.25

Enter your choice

Press 1 to enter data

Press 2 to get highest temperature

Press 3 to get lowest temperature

Press 4 to get highest average

Press 5 to get lowest average

Press 6 to exit

5

Lowest average is : 43.25

Enter your choice

Press 1 to enter data

Press 2 to get highest temperature

Press 3 to get lowest temperature

Press 4 to get highest average

Press 5 to get lowest average

Press 6 to exit