Solved

What Does the Following Method Do

Question 17

Multiple Choice

What does the following method do?
Public int question15( )
{
Int value1 = 0;
Int value2 = 0;
For (int j = 0; j < 12; j++)
If (candy[j] > value1)
{
Value1 = candy[j];
Value2 = j;
}
Return value2;
}


A) It returns the total number of candy bars sold
B) It returns the total number of children who sold 0 candy bars
C) It returns the total number of children who sold more than 0 candy bars
D) It returns the number of candy bars sold by the child who sold the most candy bars
E) It returns the index of the child who sold the most candy bars

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