Splitted print class into printUnformated and printFormated.
And fixed errors in print Unformated
This commit is contained in:
+7
-3
@@ -29,7 +29,7 @@ public class TextOutput {
|
||||
int letterLenght = letters.length;
|
||||
int lettersPrinted = 0;
|
||||
do {
|
||||
System.out.println();
|
||||
//System.out.println();
|
||||
currentLength = 0;
|
||||
for (int i = 0; i < columnWidth; i++) {
|
||||
if (letterLenght > 0) {
|
||||
@@ -39,8 +39,11 @@ public class TextOutput {
|
||||
currentLength++;
|
||||
}
|
||||
}
|
||||
if(!(letterLenght == 0)){
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
while (letterLenght > columnWidth);
|
||||
while (letterLenght >= columnWidth);
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -50,8 +53,9 @@ public class TextOutput {
|
||||
}
|
||||
System.out.print(word + " ");
|
||||
currentLength += word.length() + 1;
|
||||
if(words.length == word
|
||||
}
|
||||
}
|
||||
System.out.println(); //added
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user