title: Recursive methods - Ruler tick marks
body: <p>Today im working on a recursive method to place the tick marks on a ruler. The assignment says to place the tick marks and print its height and position. Assuming x &amp; y as (0,0), a width of 20 and height of 10, the program should display something like
  <br><br> Middle tick mark  - Position 10, height 10
  <br> Position 5, height 5
  <br> Position 2.5, height 2.5
  <br> Position 7.5, height 2.5
  <br> Position 15.0, height 5.0
  <br> Position 12.5, height 2.5
  <br> Position 17.5, height 2.5
  <br> <br>Note the smallest height allowed is 2.00, and each position is half the height of the larger one. I tried a lot of stuff and I kind of have the idea, but is not working. I get the numbers from position 10 to 7.5, but the right side is a mess even though is just moving the x coordinate. This is my code, hope you can help me and thank you.</p>
  
  <pre><code>*main method contains the input for user and the method calls.
          DrawRulerLeft(x,y,width,height);     //Method to draw left part of rule
          DrawRulerRight(x,y,width,height);   //Method to draw right part of rule
  
  public static void DrawRulerLeft(double x, double y, double w, double h) {
  
    if (h &gt; 2 ) {  //smallest height aloud
          w = w/2;  
          System.out.println("Tick position:+ w + " Tick height: " + h );
          DrawRulerLeft(x, y, w, h/2);
   } 
   }
  
  //Recursive method to draw right of rule
   public static void DrawRulerRight(double x, double y, double w, double h) {
  
       if (h &gt; 2 &amp;&amp; w &gt;= 0) {
          DrawRulerRight(x+w/2,y,w/2,h/2); 
          System.out.println("Tick position:" + x + " Tick height: " + h );
           }
  
      }
  </code></pre>