case 'a':
System.out.println("The design is");
for (int row = 1; row <= num; row++)
{
for (int star = 1; star <= row; star++)
System.out.print("*");
System.out.println();
}
break;
So I am writing a program that outputs pyramids of stars. The above code outputs a shape like this:
*
**
***
etc.
However, I need to write a code just like this but reversed so it comes out like this and :
---*
--**
-***
****
etc.
the etc. is based off the inputted number...And the (-) are spaces, it keeps aligning it to the left in my post.
Can anyone help me? I don't know where to even begin...Thanks.
This post has been edited by NeedJavaHelp22322: 02 March 2011 - 06:25 PM

New Topic/Question
Reply




MultiQuote



|