print
tf ist different to print
ln!
what you are looking for is
Code
printf("Euro %.2f", 34.565);
which prints:
Code
Euro 34.57
but this will work with "System.out." and print it to the console. If you want to write it to a File you should use a logger and pass the log to a FileWriter...
I am not quite sure what this is for but if you want to use output on console I suggest using arrays.
Something like:
Code
String name = "Bob the Builder";
String[] strings = {"Gross Amount", "Federal Tax", "State Tax", "Social Security Tax",
"Medicare/Medicaid Tax", "Pension Plan", "Health Insurance", "Net Pay"};
double[] numbers = {3575, 536.25, 125.12500000000001, 205.5625, 98.3125, 178.75, 75.0, 2356.0};
System.out.println(name);
for(int i=0;i<strings.length;i++){
System.out.printf(strings[i] + ": $ %.2F", numbers[i]);
}