To clarify this, this is homework. I'm just looking for advice, I'm not looking for someone to do my homework for me.
I already did the first half. It uses two arrays to print the Asterisk project (in this case, the letter “S.”. This works fine. Then I skip two lines and print the design, but it flips (so that each line is reversed)., But when I run the program, it prints two S and the second one is not canceled. Any ideas on what I am doing wrong?
public class Design { public static void main (String [] args) { char [] array = new char [150]; for (int index = 0; index < array.length; index ++) { array [index] = '#'; } int [] indexNumbers = { 0,1,2,3,4,5,6,7,8,9,10,20,30,40,50, 60,70,71,72,73,74,75,76,77,78,79,89,99,109,119,129,139,140, 141,142,143,144,145,146,147,148,149 }; for (int i = 0; i < indexNumbers.length; i++) { array [indexNumbers[i]] = ' '; } for (int index = 0; index < array.length; index ++) { if (index % 10 == 0 && index > 0) System.out.println(); System.out.print (array[index]); } //Now, to reverse the letter System.out.println(); System.out.println(); int lines = 5; for (int i = 0; i< array.length; i++){ if (i >= lines) lines += 10; char temp = array [i]; array [i] = array [lines - i - 1]; array [lines - i - 1] = temp; } for (int index = 0; index < array.length; index ++) { if (index % 10 == 0 && index > 0) System.out.println(); System.out.print (array[index]); } } }
EDIT: Yes ... design in spaces, everything else is asterisks.