subject
Engineering, 05.05.2020 21:43 lawhornmakayla

Write a Java method that takes a one dimensional array of doubles as a parameter. The method returns the absolute difference between the sum of numbers lower than the value in the middle of the array and the sum of numbers higher or equal to the middle value. Write a program to test your method.

Note: When the array length is even, the middle value is the average of the two values in the middle.

Use the following arrays to test your program:

Case #1, the length of array is odd: [8.5 32.8 27.2 19.1 6.5 17.6 24.2 23.1 20.6 13.2 28.4 14.7 18.6], for this case your program should output: 29.30

Case #2, length of array is even: [8.5 32.8 6.2 19.1 15.5 17.6 12.2 3.2 28.4 14.7], for this case your program should output: 37.60

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
question
Engineering, 04.07.2019 19:10
What is the main objective of using reheat rankine cycle?
Answers: 3
question
Engineering, 04.07.2019 19:10
The sum of the normal stresses does not change as the stress state rotates through an angle. a)-trune b)- false
Answers: 2
You know the right answer?
Write a Java method that takes a one dimensional array of doubles as a parameter. The method returns...
Questions
question
Mathematics, 12.08.2020 05:01
question
Biology, 12.08.2020 05:01
question
Social Studies, 12.08.2020 05:01
question
Mathematics, 12.08.2020 05:01
Questions on the website: 13722362