A method called printIndented() that takes a String, an integer and a boolean. The
integer represents the size of an indentation from the left margin in spaces, so the
method should first p
rint that many spaces. Then the string should be printed.
Then, if the boolean is true, a newline should be printed. So for example,
printIndented(3, "Hello", false)
would print:
˽˽˽
Hello
...with no newline at the end.
I'm stuck with this. my version is incomplete:
int printIndented(int size, String word, boolean n) {
String spaces = ("");
print(spaces);
print(word);
if(n == true) println("");
else
if(n == false) print("");
return(size);