Question: Write a static method findFigure(picture,threshold), where picture is a twodimensional array of double values. The method should return a new two-dimensional array whose elements are

Write a static method findFigure(picture,threshold), where picture is a twodimensional array of double values. The method should return a new two-dimensional array whose elements are either 0.0 or 1.0. Each 1.0 in this new array indicates that the corresponding value in picture exceeds threshold times the average of all values in picture. Other elements in the new array are 0.0. For example, if the values in picture are 

1.2 1.3 4.5 6.2 2.7 1.7 3.3 4.4 10.5 17.0 1.1 4.5 2.1 25.3 9.2 1.0 9.5 8.3 2.9 2.1


the average value is 5.55. The resulting array for a threshold of 1.4 would be

1.2 1.3 4.5 6.2 2.7 1.7 3.3 4.4 10.5 17.0 1.1 4.5


and the resulting array for a threshold of 0.6 would be

2.1 25.3 9.2 1.0 9.5 8.3 2.9 2.1

1.2 1.3 4.5 6.2 2.7 1.7 3.3 4.4 10.5 17.0 1.1 4.5 2.1 25.3 9.2 1.0 9.5 8.3 2.9 2.1

Step by Step Solution

3.40 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public static double findFiguredouble pictu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java An Introduction to Problem Solving and Progra Questions!