I would like to create an hourglass using the \"*\" character. For example if the user input was 5 then it would look like this:
***** *** * *** ***** >
Pseudocode:
function stars(n): c1 = 0 c2 = n for i = 1 to n print ' ' * c1 print '*' * c2 if (i < (n+1) / 2): c1 ++; c2 -=2; else: c1-- c2 +=2 print newline
This should get you close to your answer... now translate into java
** note - this works for odd number. You may need to tweak for even n **