Ap Computer Science Help Needed (urgent)

<p>Hey guys, </p>

<p>I have a project due for AP Computer Science and I need some help. The assignment is to write a program with a recursive method that takes a string and outputs it a specified number of times. </p>

<p>This is due tommorow..ahh</p>

<p><a href="mailto:neilparikh@gmail.com">neilparikh@gmail.com</a> if you can help</p>

<p>It should be easy ( if I am undersanding this correctly)</p>

<p>public void method ( String string, int timesToOutput)
{
if ( timesToOutput == 0)
{ System.out.print(""); }
else
{
System.out.println(string);
method( string, timesToOutput - 1);
}
}</p>

<p>well...more commonly...</p>

<p>if ( timesToOutput == 0)
{ return; }</p>

<p>because it looks nicer...</p>

<p>Yes, but then you have to worry about including "return" for the else statement which would complicate the matter if you needed to output, and not return a string.
The best thing to do:</p>

<p>if ( timesToOutput == 0)
{ }
Just leave it blanck...</p>

<p>why would you have to return the else statement??
it doesnt return a value...</p>

<p>and never leave brackets empty like that it is silly...
in that case, do:</p>

<p>if (timesToOutput !=0){
SOP(string);
method(string, timesToOutput);
}</p>

<p>All right, nevertherless, all of these ways are effective.</p>