title: Converting random numbers into XY coordinates for graphing
body: <p>My professor gave us an assignment to test the difference in runtimes and search sizes using linear &amp; binary algorithms, and the data is to be graphed.</p>
  
  <p>I have the search methods put the runtime &amp; array sizes as Points in an ArrayList, which is then sent to the GraphResults class for plotting.  I need to convert those data points into xy coordinates before.  The search size is the x-axis and the runtime is the y axis</p>
  
  <p>As the search sizes are fixed as a multiple of 128 and there are only 8 sizes, I used switch for calculating the x value, but am looking for a more efficient way to convert the runtimes into coordinates.</p>
  
  <p>Right now, I'm using nested conditionals with 5 like this:</p>
  
  <pre><code>if (y&lt;=1000) {
      if (y&lt;= 500) { 
          if (y&lt;= 250) {
              newy= yaxis-32; }//equals to 250ms category
          else {
              newy= yaxis-(32*2); }//500ms category
     } 
  else if (y&lt;=750) {
      newy= yaxis-(32*3);} //750ms category
  else {
      newy= yaxis-(32*4);} //1000ms category
  } //end of the 1000ms tests
  </code></pre>
  
  <p>Right now, the numbers that are over 5000ms require 7 tests.  Is there a more efficient way to assign a number based on a number size?</p>