Solved

Select the Statement That Reveals the Logic Error in the Following

Question 42

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents