title: How to get code to double values (x * 2) less than 10 in an array? (Java)
body: <p>I'm taking an online Java programming class (I'm a beginner) and I cannot figure how to correctly complete the code. I've already written what I think is to be included, however I'm missing something that would make the code work completely.</p>
  
  <p><strong>Directions:</strong>
  Double any element's value that is less than minVal. Ex: If <code>minVal = 10</code>, then <code>dataPoints = {2, 12, 9, 20}</code> becomes <code>{4, 12, 18, 20}</code>.</p>
  
  <pre><code>public class StudentScores {
     public static void main (String [] args) {
        final int NUM_POINTS = 4;
        int[] dataPoints = new int[NUM_POINTS];
        int minVal = 0;
        int i = 0;
  
        dataPoints[0] = 2;
        dataPoints[1] = 12;
        dataPoints[2] = 9;
        dataPoints[3] = 20;
  
        minVal = 10;
      // DO NOT EDIT ANYTHING ABOVE THIS COMMENT. ABOVE IS THE DEFAULT CODE OF ASSIGNMENT
  
        for (i = 0; dataPoints[i] &lt; minVal; ++i) {
           dataPoints[i] = dataPoints[i] * 2;
        }
  
      // DO NOT EDIT ANYTHING BELOW THIS COMMENT. BELOW IS DEFAULT CODE OF ASSIGNMENT
        for (i = 0; i &lt; NUM_POINTS; ++i) {
           System.out.print(dataPoints[i] + " ");
        }
        System.out.println();
  
        return;
     }
  }
  </code></pre>
  
  <p>I made comments of what isn't to be messed with, as I am using an online interactive book and cannot edit or change the default code. Additionally, we are working with arrays in this chapter.</p>
  
  <p>I'm new to this site in the sense that I don't know the unwritten ways of stackoverflow, but I've search multiple times online to see how to double the values for an array in java but I do not get the search results I need to help me.</p>
  
  <p>The error messages I get are:</p>
  
  <pre><code>Testing minVal = 10 and dataPoints = {2, 12, 9, 20}
  Expected output:  4 12 18 20 
  Your output:  4 12 9 20 
  </code></pre>
  
  <p>I thought that the compiler should be able to read the lines fully to register that 9 is also less than 10 and thus should be doubled to 18, but it doesn't. What am I missing to make 9 be read as well?</p>