I need some help making some star patterns. The exact instructions are as follows:
Create separate programs to produce the following patterns:
a.
*
**
***
****
*****
b.
*****
****
***
**
*
I have to use for loops to get the patterns and I've already got (a.) but I can't seem to get the second. My first pattern's code is this:
public class Stars
{
//-------------------------------------------
//Prints a triangle shape using asterick (star) characters.
//-----------------------------------------------------------
public static void main (String[] args)
{
final int MAX_ROWS = 10;
for (int row = 1; row <= MAX_ROWS; row++)
{
for (int star = 1; star <= row; star++)
System.out.print ("*");
System.out.println();
}
}
}
Please help? Thanks in advance!