KingOfActing
lukewarm mess
I posted a Java solution for it earlierWhat's the solution, seems really tricky. Specifically the fact that there's numbers >9.
Java:Here's another one a bit harder IMO, from a past comp1917 exam.
// you can assume size is an odd positive value
// this function is to print on the screen a cross
// made of asterisks which fits inside a square of
// side length "size"
// void drawCross (int size);
Code:
public static void drawCross(int size)
{
for(int i = 0; i < size; i++)
{
char[] array = new char[size];
for(int j = 0; j < size; j++)
{
array[j] = ' ';
}
array[i] = '*';
array[size - i - 1] = '*';
System.out.println(new String(array));
}
}
My question is still unanswered Side note: anyone know how to do java syntax highlighting (if it's possible) on this forum?