printf problem

Hi,

This is the code i have so far my only question is why is my printf not working, it is returning an error. I need to print a (string, double) and a (string, double, int), but i dont know what to use. Thx Here is par of the code...

System.out.print("What annual income do you require for retirement? " +

"(amount in today's dollars): ");

double income = keyboard.nextDouble();

keyboard.nextLine();

calc.setCF(income);

System.out.print("What real annual rate of return do you expect " +

"on your investments? (rate in percent, after inflation): ");

double rate = keyboard.nextDouble();

keyboard.nextLine();

calc.setRate(rate/100);

System.out.print("How many years will you live in retirement? ");

int retirementYears = keyboard.nextInt();

keyboard.nextLine();

calc.setN(retirementYears);

System.out.print("How many years do you have until retirement? ");

int workingYears = keyboard.nextInt();

keyboard.nextLine();

calc.setT(workingYears);

// perform calculation and display results -- present value of goal

double pv = calc.calculatePV();

System.out.printf("The present value cost of your retirement " +

"goal is $%,.2f \n", pv);

// perform calculation and display result -- annual investments

// required to achieve goal

double cf = calc.calculateEACF();

System.out.printf("This will require annual investments of " +

"$%,.2f for the next %d working years.\n",

cf, (int)calc.getN());

System.out.println();

System.out.print("again/quit?: ");

}

while ( !keyboard.nextLine().equalsIgnoreCase("quit") );

} // public static void main(String args[])

} // class RetirementPlanner

both printf's are returning cmpiler errors

[1847 byte] By [rosas101a] at [2007-11-27 0:44:42]
# 1
both printf are almost at the end of te code...
rosas101a at 2007-7-11 23:09:14 > top of Java-index,Developer Tools,Java Compiler...
# 2
What is the error message given?
naansofta at 2007-7-11 23:09:14 > top of Java-index,Developer Tools,Java Compiler...