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, 03.07.2019 15:10
Apiston-cylinder with a volume of 0.25 m3 holds 1 kg of air (r 0.287 k/kgk) at a temperature of 100 c. heat transfer to the cylinder causes an isothermal expansion of the piston until the volume triples. how much heat is added to the piston-cylinder?
Answers: 3
question
Engineering, 04.07.2019 16:10
An electrical motor raises a 50kg load at a construct velencity .calculate the power of the motor, if it takes 40sec to raise the load through a height of 24m(take g =9.8n/g)
Answers: 2
question
Engineering, 04.07.2019 18:10
Give heat transfer applications for the following, (i) gas turbines (propulsion) ) gas turbines (power generation). (iii) steam turbines. (iv) combined heat and power (chp). (v) automotive engines
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
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, 26.06.2019 20:40
question
Mathematics, 26.06.2019 20:40
Questions on the website: 13722363