What is wrong with the formatting in my Java code? : <p>I've been told that there are problems with my formatting, at the end. However, I can't figure out what that would be...The error messages are at the end of the code.
PLEASE DON'T BE AMBIGUOUS WITH YOUR ANSWERS AND TELL ME WHAT TO FOCUS ON OR REVIEW (LIKE FORMATTING).I NEED CONCRETE THINGS TO CHANGE. Thank you!!
Here's the code: </p>

<pre><code>public static void main(String[] args)
{
    double pennies =  0.01;     //number of pennies
    double totalPennies = 0.01; //the variable that is added to 
    int maxDays;            //number of days the loop will double the pennies to
    int day = 0;                //the variable used to count each day in the loop

    //Create a String variable for user input with a console window. 
    String input;
    //Create a scanner object for keyboard input into the console. 
    Scanner keyboard = new Scanner(System.in);

    //Ask user for the number of days to count.
    input = JOptionPane.showInputDialog("Enter the maximum number of days worked in your pay period"
            + " and I will tell you how much money you made. Please enter at least 1."); 
    maxDays = Integer.parseInt(input);      //this makes the user's string input into 
                                        //an integer data type  

    //Input Validation
    while(maxDays &lt; 1)
    {
        System.out.println("You have entered a number that "
                + "is less than 1. \nPlease enter a number that is at"
                + " least 1 or more:");
        maxDays = keyboard.nextInt();
    }


    //next we have the first loop that will only execute if the user enters at least 1 
    while(maxDays &gt;= 1)
    {
        //here's the chart
        System.out.println("Day       Day's Income    Total "); //titles for the chart
        System.out.println("----------------------------------"); //34 dashes/spaces 
        System.out.println("1         $0.01             $0.01 "); //the first day 

        //this next nested loop will do the actual counting and add to the chart with  
        //each iteration
        for(day = 2; day &lt;= maxDays; day++)
        {
            pennies = pennies * 2;      //double pennies
            totalPennies += pennies;    //add the new value of pennies to the running total

            //add information from each iteration to the chart
            System.out.printf("%10.0d" + "$%18.0f" + "$%6.0f", day, pennies, totalPennies );


        }

    }
}
</code></pre>

<p>Here are the error messages:</p>

<pre><code>Exception in thread "main" java.util.IllegalFormatPrecisionException: 0
at java.util.Formatter$FormatSpecifier.checkInteger(Formatter.java:2984)
at java.util.Formatter$FormatSpecifier.&lt;init&gt;(Formatter.java:2729)
at java.util.Formatter.parse(Formatter.java:2560)
at java.util.Formatter.format(Formatter.java:2501)
at java.io.PrintStream.format(PrintStream.java:970)
at java.io.PrintStream.printf(PrintStream.java:871)
at assignment4PenniesForPay.assignment4PenniesForPay.main(assignment4PenniesForPay.java:65)
</code></pre>

<p>Line 65 is the formatting line. </p>
