title: Printing Stars based on input from Command Prompt
body: <p>I have bee assigned a project to print out patterns of stars. We are suppose to take a number given in the CMD and have it print out a pattern. Or atleast that's how I understand it. </p>
  
  <hr>
  
  <p>Here is what the assignment says:</p>
  
  <blockquote>
    <p>Take a numeric input from the command line and produce the correct
    number of stars and rows.</p>
  </blockquote>
  
  <p>Example:</p>
  
  <pre><code>C:\java Stars 3 
  </code></pre>
  
  <p>will produce, </p>
  
  <pre><code>*
  **
  ***
  </code></pre>
  
  <hr>
  
  <p>Here is my code so far:</p>
  
  <pre><code>public class Stars1
  {
      public static void main(String[] args)
      {
           int len = args.length;
  
           if( len &lt;= 0)
           {
               System.out.println(" ERROR: Please input a value of 1-5");
               System.exit(0);
           }  
  
          int j;
          for(int i = 0; i &lt;= 4; i++)
          {
              for(j = 0; j &lt;= i; j++)
                  System.out.print("*");
  
              System.out.println("");
  
  
          }
  
  
      }
  } 
  </code></pre>
  
  <p>I am trying to produce the pattern:</p>
  
  <pre><code>*
  **
  ***
  ****
  *****
  </code></pre>
  
  <p>The example code he showed us used args.length to echo back what ever was typed via Command Prompt. So if we typed in <code>C:\ java Echo I type, it types.</code> 
  It would print out <code>I type, it types.</code></p>
  
  <p>Here is the code he told us to look at:</p>
  
  <pre><code>public class echo
  {
      public static void sopl( String str )
      {
          System.out.println( "\t" + str );
      }
  
      public static void sop( String str )
      {
          System.out.print( str );
      }
  
  
  
  
  
      public static void main( String[] args )
      {
          int len = args.length;
  
          if( len == 0 )
          {
              sopl( "\n\tUsage: java echo &lt;args:String[]&gt;" );
              System.exit( 0 );
          }
  
          sop( "\n\t" );
  
          for( int i = 0; i &lt; len; i++ ) sop( args[i] + " " );
  
          sop( "\n\t" );
  
          while( len &gt; 0 ) sop( args[args.length - len--] + " " );
  
          sopl( "" );
      }
  </code></pre>
  
  <p>How can I use the args.length to produce the pattern? I can get it to produce the pattern easily without having to take input form the command line. </p>