completed max, middle_element, sum_arrays problems

Please check the  max, middle_element, sum_arrays problems.
Thank you!
You can just use array[x] here if you set x to
x = (array.length-1)/2.0