i am supposed to Write a program that prints a shape similar to the following shape. Maximize use of loops and minimize use of print statements.
.....*
....**
...***
..****
...***
....**
.....*
(without the "...")(i couldn't get it to stay in shape)
this is what i got so far
package assignment7; public class Exercise3 { public static void main (String[] args) { for (int count =0; count < 4; count++) { for (int j=0; j < count+1; j++) System.out.print("*"); System.out.println(); } for (int count =3; count >= 0; count--) { for (int j=0; j < count-1; j++) System.out.print("*"); System.out.println(); } } }
this compiles to:
*
**
***
****
**
*
how do i center it to create the shape?