0

I'm a beginner, and I was wondering how to write a java code for this:

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

I'm using DrJava. This is supposed to be in a diamond formation. Hopefully it posts that way.

Thank you :)

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by VernonDozier
0

by doing your own homework and research. This question has been asked and answered a million times before.
Only the exceptionally lazy and exceptionally incompetent will be unable to by now find the answer, and they don't deserve the answer.

0

This is supposed to be in a diamond formation. Hopefully it posts that way.

No, it doesn't post correctly. You need to use code tags.

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

And it still won't display correctly (see above) since you need to use a Courier font when you design it. Design it in a word processor in Courier font, then copy and paste here using code tags.

[code=text] // diamond goes here.

[/code]
You need to use a loop within a loop and you need to display spaces, asterisks, and newlines within the loops, a character at a time.

Edited by VernonDozier: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.