@@ -0,0 +1,968 @@
+import java.util.Scanner;%0A%0Apublic class FormattingNumbers %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scan = new Scanner(System.in);%0A        int a = scan.nextInt();%0A        double b = scan.nextDouble();%0A        double c = scan.nextDouble();%0A%0A        System.out.print('%7C');%0A        System.out.print(String.format(%22%251$-10s%22, Integer.toHexString(a).toUpperCase()));%0A        System.out.print('%7C');%0A        System.out.print(String.format(%22%25010d%22, Integer.parseInt(Integer.toBinaryString(a))));%0A        System.out.print('%7C');%0A%0A        // This will always print trailing zeroes%0A        // This is intentional, because it is closer to the problem specified%0A        // even if the example seems wrong.%0A        System.out.print(String.format(%22%251$10s%22, String.format(%22%25.2f%22, b)));%0A        System.out.print('%7C');%0A        System.out.print(String.format(%22%251$-10s%22, String.format(%22%25.3f%22, c)));%0A        System.out.print('%7C');%0A        System.out.println();%0A    %7D%0A%7D%0A

Solve homework2-problem6: Formatting Numbers