// Instead of :: out.write(" "); // i ..
out.write(getSpace(20- text.length())); // Here 20 is max length possible change accordingly
...
public static String getSpace(int length){
String str = "";
for(int i = 0 ; i < length ; i++ ){
str = str + " " ;
}
return str ;
}
Should align the score ..