Which XXX and YYY correctly output the smallest values? Array userVals contains 100 elements that are integers (which may be positive or negative). Choices are in the form XXX / YYY. // Determine smallest (min) value int minVal; XXX for (i = 0; i < 100; ++i) { if (YYY) { minVal = userVals[i]; } } System.out.println("Min: " + minVal);     a. minVal = 0; / userVal > minVal   b.   minVal = 0; / userVal < minVal     c. minVal = userVals[0]; / userVals[i] > minVal   d.   minVal = userVals[0]; / userVals[i] < minVal     JAVA

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 16RQ
icon
Related questions
Question
  1. Which XXX and YYY correctly output the smallest values? Array userVals contains 100 elements that are integers (which may be positive or negative). Choices are in the form XXX / YYY.

    // Determine smallest (min) value
    int minVal;
    XXX
    for (i = 0; i < 100; ++i) {
    if (YYY) {
    minVal = userVals[i];
    }
    }
    System.out.println("Min: " + minVal);








     

      a.

    minVal = 0; / userVal > minVal

      b.

     

    <code>minVal = 0; / userVal < minVal</code>

     

      c.

    minVal = userVals[0]; / userVals[i] > minVal

      d.

     

    <code>minVal = userVals[0]; / userVals[i] < minVal</code>

     

     

    JAVA

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning