import java.util.Formatter; public class Demo { public static void main(String[] argv) throws Exception { double arr[] = { 2.5, 4.8, 5.7, 6.5, 9.4, 8.4, 9.5, 10.2, 11.5 }; Formatter f = new Formatter(); f.format("%12s %12s %12s\n", "Points1", "Points2", "Points3"); System.out.println("The point list...\n"); for (double d : arr) { f.format("%12.2f %12.2f %12.2f\n", d, Math.ceil(d), Math.floor(d)); } System.out.println(f); } }