subject

Consider the following method, which is intended to return the element of a 2-dimensional array that is closest in value to a specified number, val. /** @return the element of 2-dimensional array mat whose value is closest to val */ public double findclosest(double[][] mat, double val) { double answer = mat[0][0]; double mindiff = math. abs(answer - val); for (double[] row : mat) { for (double num : row) { if ( /* missing code */ ) { answer = num; mindiff = math. abs(num - val); } } } return answer; } which of the following could be used to replace /* missing code */ so that findclosest() will work as intended?

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:00, kayladgranger
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, jhitotw
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
image
Computers and Technology, 23.06.2019 17:00, chrisgaz14
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, keel5468
You draw two cards from a standard deck of 52 cards, but before you draw the second card, you put the first one back and reshuffle the deck. (a) are the outcomes on the two cards independent? why?
Answers: 3
You know the right answer?
Consider the following method, which is intended to return the element of a 2-dimensional array that...

Questions in other subjects:

Konu
Mathematics, 03.12.2021 22:40