Java printf statement giving errors
<p>I'm using Eclipse on an a homework assignment and I'm really struggling. The goal is to write a payroll program that has a user enter their name, hours worked, pay rate, federal and state tax withheld, and then outputs the calculated information of their amounts withheld as well as their net pay. </p>

<p>I used what I was familiar with which is <code>println</code> statements to show the output but the teacher wants us to use the <code>System.out.printf</code> function and I can't get it to work at all. If I use <code>println</code> statements all the values fill but for some reason I can't manage to get the <code>printf</code> to do the same. What am I missing? If I use the <code>printf</code> function it gives me the error of </p>

<pre><code>"Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    The method printf(Locale, String, Object[]) in the type PrintStream is not applicable for the arguments (String, String, String)
at Payrolls.main(Payrolls.java:31)"
</code></pre>

<p>Here's my code:</p>

<pre><code>import java.util.Scanner;

public class Payrolls
{
   public static void main(String []args)
   {


   Scanner input = new Scanner(System.in);

   System.out.print("Enter employee first name: ");
   String employeeFirst = input.nextLine();

   System.out.print("Enter employee last name: ");
   String employeeLast = input.nextLine();

   System.out.print("Enter number of hours worked this week: ");
   int hoursWorked = input.nextInt();

   System.out.print("Enter hourly pay rate of the employee: ");
   double payRate = input.nextDouble();

   System.out.print("Enter federal tax withholding rate: ");
   double fedTax = input.nextDouble();

   System.out.print("Enter state tax withholding rate: ");
   double stateTax = input.nextDouble();

   System.out.println(" ");
   System.out.println(" ");
   //System.out.printf("%-20s %s\n", employeeFirst, employeeLast);
   System.out.println("Name: " + employeeFirst +" " +employeeLast);

   System.out.println("Hours Worked:" + hoursWorked);

   System.out.println("Pay Rate:" + payRate);



   double grossPay;
   grossPay = payRate * hoursWorked;

   System.out.println("Gross Pay:" + grossPay);

   double deductions;
   deductions = grossPay * fedTax;

   System.out.println("\tDeductions:");
   System.out.println("\t\tFederal Witholding %: $" +  deductions);

   double statTax;
   statTax = grossPay * stateTax;

   System.out.println("\t\tState Witholding %: $" +  statTax);

   double totalDeduction;
   totalDeduction = deductions + statTax;

   System.out.println("\t\tTotal Deduction: $" + totalDeduction);


   double netPay;
   netPay = grossPay - totalDeduction;

   System.out.println("Net Pay:" + netPay);
   }
}
</code></pre>