title: How to fix "java.util.MissingFormatArgumentException:" for %s in Java code
body: <p>I am coding for my Java class and I am getting a "java.util.MissingFormatArgumentException:" Error when I use %s for the System.out.printf .  </p>
  
  <p>I've tried keeping it all in the "    " marks and I have tried separating out.</p>
  
  <p>This is my code:</p>
  
  <pre><code>    System.out.println("your bill is: ");
          System.out.printf("%30s", "Item" + "%10s", "Quantity", "%-10s", "Price", "%-10s", "Total");
          System.out.printf("\n %s" + firstItem + "%10.2f" + firstItemQuant + "%10f" + firstItemPrice + "%10.2f" + firstItemTotal);
          System.out.printf("\n %s" + secondItem + "%10.2f" + secondItemQuant + "%10f" + secondItemPrice + "%10.2f" + secondItemTotal);
          System.out.printf("\n %s" + thirdItem + "10.2f" + thirdItemQuant + "%10f" + thirdItemPrice + "%10.2f" + thirdItemTotal);
          System.out.printf("\n %s -----------");
          System.out.printf("\n %s Subtotal %50f" + subtotal);
  </code></pre>
  
  <p>I am getting this as a result:</p>
  
  <pre><code>    your bill is: 
                        Item%10s
   Exception in thread "main" java.util.MissingFormatArgumentException: Format specifier '%s'
      at java.util.Formatter.format(Unknown Source)
      at java.io.PrintStream.format(Unknown Source)
      at java.io.PrintStream.printf(Unknown Source)
      at assignment1.main(assignment1.java:67)
  </code></pre>
  
  <p>I just want the bill to be formatted into columns</p>