title: I need help getting my code to look like this:
body: <p>I need help getting my code output to look like the image below and I am not sure what I am doing wrong and I need to have my code output indented and cant remember how to indent it.</p>
  
  <p>Here is my code currently:</p>
  
  <pre><code>// Fig. 18.3: FactorialCalculator.java
  // Recursive factorial method.
  
  public class Assignment_6_1 
  {
      // recursive method factorial (assumes its parameter is &gt;= 0
      static StringBuilder s = new StringBuilder();
  
      public static long factorial(long number) 
  {
          if (number == 0) // test for base case
          {
              return 1; 
          } else {// recursion step         
              if (s.length() == 0) {
                  s.append(number).append("*").append(number - 1);
              } else {
                  for (int i = 0; i &lt; s.length(); i++) {
  
                  }
                  System.out.println(number + " * " + (number - 1) + "!");
                  s.append("*").append(number).append("*").append(number - 1);
              }
              return number * factorial(number - 1);
          }
      }
  
      // output factorials for values 0-21
      public static void main(String[] args) {
          System.out.println("Hannah Coffey - Lab 6");
          // calculate the factorials of 0 through 20
          for (int counter = 0; counter &lt; 25; counter++) {
              s = new StringBuilder();
              System.out.println(counter + "!");
              System.out.printf("%d! = %d%n", counter, factorial(counter));
          }
      }
  } // end class FactorialCalculator
  </code></pre>
  
  <p>Here is what I need it to look like and not sure what I am doing wrong:</p>
  
  <p><a href="https://i.stack.imgur.com/fU6ik.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fU6ik.png" alt="enter image description here"></a></p>
  
  <p>Any Help would be greatly appreciated.</p>
  
  <p>My program currently looks like this:
  <a href="https://i.stack.imgur.com/Rtwtf.png" rel="nofollow noreferrer">enter image description here</a></p>