Multiple Choice
Select the statement that reveals the logic error in the following method. public static double minimum(double[] data)
{
Double smallest = 0.0;
For (int i = 0; i < data.length; i++)
{
If (data[i] < smallest)
{
Smallest = data[i];
}
}
Return smallest;
}
A) double m = minimum(new double[] { 1.2, -3.5, 6.6, 2.4 }) ;
B) double m = minimum(new double[] { 1.2, 23.5, 16.6, -23.4 }) ;
C) double m = minimum(new double[] { -10.2, 3.5, 62.6, 21.4 }) ;
D) double m = minimum(new double[] { 12.2, 31.5, 6.6, 2.4 }) ;
Correct Answer:

Verified
Correct Answer:
Verified
Q6: When an integer literal is added to
Q94: What will be printed by the statements
Q95: Assume the method doSomething has been defined
Q96: Consider the following code snippet: public static
Q97: Consider the following line of code for
Q98: Assume the following variable has been declared
Q100: Which statement is true about the code
Q101: Which one of the following statements is
Q102: Which one of the following is the
Q103: Is there any thing wrong with the