To complete Challenge 58, the following code must be placed into BlueJ™:
public class Challenge058
{
public void drawStars(int n)
{
if (n != 0)
{
for (int x = 0; x < n; x++)
System.out.print("*");
System.out.print("\n");
drawStars(n - 1);
}
else
System.out.println("No more stars for you!");
}
}
−Phoenix
Good work. 600 XPs awarded.
ReplyDelete