The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Need assistance

Posted by PM on September 11, 2001 at 5:23 PM

Hello All:

Teaching myself Java and came across these problems via a internet site; can you show me how this is done? Unfortunately there are no examples or answers to them.

Thank you


Write a program which draws a triangle of asterisks

*
**
***
****

*
**
***
****
*****

Modify the program so that the triangles appear upside down eg.

****
***
**
*

Now modify the program so that the triangles appear flipped vertically eg.

���*
��**
�***
****
Next modify the program so that the triangles appear flipped vertically and upside down eg.

****
�***
��**
���*
Finally modify the program so that the triangles are symmetrical, that is, they appear like this for 4 and 5 respectively

���*
��***
�*****
*******
����*
���***
��*****
�*******
*********



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us