Question: Create a Java file named ArrayMinMax.java, declare and initialize the following array of double type as {20.8, 56.4, 12.1, 37.2, 25.3, 1.6, 8.9, 76.9, 45.8,

Create a Java file named ArrayMinMax.java, declare and initialize the following array

of double type as {20.8, 56.4, 12.1, 37.2, 25.3, 1.6, 8.9, 76.9, 45.8, 62.5, 98.7, 81.4}. First, find

the maximum from the even-numbered elements (That is, the max array element from the 2nd,

4th, 6th, 8th, 10th, 12th elements in the above array). Next, find the minimum from the oddnumbered

elements (That is, the min array element from the 1st, 3rd, 5th, 7th, 9th, 11th elements in

the above array). Note that you must output both the array index as well as the value (for

example, since 81.4 is the max for all even-numbered elements, your output should contain its

array index 11 as well as the value 81.4).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!