Question: Write a java program with a function that takes as an input parameter an array of type Double, and returns the array containing the middle
Write a java program with a function that takes as an input parameter an array of type Double, and returns the array containing the middle values of all three-consecutive values in the original array. for example, if the array is {10.3 25.3 26.4 14.4 19.9} it would return 25.3 because it is the middle of 10.3 26.4 and 25.3 then it would return 25.3 again because it is the middle of 25.3 26.4 and 14.4
Ive gotten one response that used things like linkedhashset and i havent learned that yet was wondering if somebody could do it using basic for loops. Also i know the directions arent very clear but it needs to return the middle value not the average of three consecutive values.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
