Write a static method find Figure(picture,threshold), where picture is a two-dimensional 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 | 20.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
0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
0.0 | 0.0 | 0.0 | 1.0 | 1.0 |
0.0 | 0.0 | 0.0 | 1.0 | 1.0 |
0.0 | 1.0 | 0.0 | 0.0 | 0.0 |
and the resulting array for a threshold of 0.6 would be
0.0 | 0.0 | 1.0 | 1.0 | 0.0 |
0.0 | 0.0 | 1.0 | 1.0 | 1.0 |
0.0 | 1.0 | 0.0 | 1.0 | 1.0 |
0.0 | 1.0 | 1.0 | 0.0 | 0.0 |
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.