Java How to Program 6/e exercise problem?
Posted Monday, June 14, 2010 by admin
I’ve just started learning very basic Java programming. You have this question in the book – Write an application to display a box, an oval, an arrow and a diamond using asterisks. I don’t even know where to start. The only thing I can manage is the box and that too only by itself. How do I do this?




If you know your geometry girl… apply the right formulas.
Try to look for similarity in figures and apply the right loops with right conditions.
It would be easier to show you if Answers allowed code areas or some other way of using monospaced fonts and extra spacing, but I believe the question wants you to display something like this:
*********
*———*
*———*
*********
—***
-*—–*
*——-*
-*—–*
—***
—-*
–*—*
*——-*
–*—*
–*—*
–****
—-*
–*—*
*——-*
–*—*
—-*
Except with spaces instead of dashes. This is just to give you the visual gist of it.