import java.util.Scanner;

/**********************************************************************
 * Class purpose: Produce Star patterns demonstrating nested loops
 * 
 * @author  Lewis and Loftus, Nancy & Arch Harris (V2), your name (V3)
 * @version V2 10/26/05
 *********************************************************************/
public class Stars
{

   /******************************************************************
    * Method purpose:  Prints star patterns. 
    *
    * @param args Command line arguments, ignored
    *****************************************************************/
   public static void main (String[] args)
   {
      int      maxRows;    // maximum number of rows to print
      int      starCnt;    // Stars per row
      int      blnkCnt;    // Blanks preceding the stars

      Scanner  stdIn;      // standard input

      stdIn = new Scanner(System.in);
 
      System.out.print("Enter a positive number for the number of rows: ");
      maxRows = stdIn.nextInt();

      while (maxRows <= 0)
      {
         System.out.printf("\nYou did not enter a POSITIVE number.  You entered %d!\n", maxRows);  
         System.out.print("Enter a positive number for the number of rows: ");
         maxRows = stdIn.nextInt();
      }
      
      //**************************************************
      // First Example, stars per row goes from 1 to maxRow
      //**************************************************
      System.out.println();
      System.out.println("Class example\n");
      for (int row = 1; row <= maxRows; row++)
      {
         starCnt = row;
         for (int star = 1; star <= starCnt; star++) {
            System.out.print ("*");
         }
         System.out.println();
      }
      
      //*******************************************************
      // Insert code for patterns (A), (B), (C), and (D) below.
      //*******************************************************
   }
}
