Alright, Ive moved onto my next mission. I have to draw a set of four triangles using for loops. I have the first two done, the second two have to have spaces prior to printing the asterisks. example:
*****
****
***
**
*
*
**
***
****
*****
This is what I have so far, which does print the first two fine, I just needto know how to get my spacing correct. Any suggestions or tips are welcome, thanks in advance, NewbyChic
public class Triangle
{
// Displays a triangle shape using asterisks
public static void main ( String[] args)
{
int maxNumRows = 10;//maximum number of rows
for ( int row = 1; row <= maxNumRows; row++ )//inner loop
{
for ( int firstTri = 1; firstTri <= row; firstTri++ ) // outer loop
System.out.print("*");
System.out.println();
}
System.out.println();
maxNumRows = 10; //minimum number of rows
for ( int row = 1; row <= maxNumRows; row++ ) //inner loop
{
for ( int secondTri = 10; secondTri >= row; secondTri-- ) //outer loop
System.out.print("*");
System.out.println();
}
} // end of main method
}