|
-
new programmer needs a bit of help
I have to modify the program
public class stars
{
public static void main ( String [] args)
{
final int maxrows = 10;
for (int row = 1; row <= maxrows; row++)
{
for (int star = 1; star <= row; star++)
System.out.print("*");
System.out.println();
}
}
}
Which displays
*
**
***
... (for 10 rows)
to display a diamond:
*
***
*****
******* <-- This should be a diamond, but for
********* some reason its not beingdisplayed
*********
*******
*****
***
*
all with using for loops (or for the most part).
I am frustrated and it seems like my mind clouds over when i try to envision how this should work, can someone please do me a favor and help me
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks