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
Which of the following ziegler nichols tuning methods the response of the controller to a step input should exhibit an s-shaped curve? a)-open loop mode b)-closed loop mode c)-both modes (open & closed) d)-none of the modes (open & closed)
Answers: 3
question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
question
Engineering, 04.07.2019 19:10
The proportional limit is always greater than the yield strength for a material. a)-trune b)- false
Answers: 3
question
Engineering, 05.07.2019 10:10
What is the correct way to measure the overall length of a boat? measure from the tip of the bow to the highest point on the gunwale. measure from the tip of the bow in a straight line to the stern of the boat. measure from the tip of the bow in a straight line to the back seat. measure from port to starboard at the boat's widest point.
Answers: 1
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, 22.02.2020 07:21
question
Mathematics, 22.02.2020 07:24
Questions on the website: 13722360