Ok so here's the deal. I need to write a program that will calculate the monthly paycheck for an employee. I have it all written out and what not. The only thing I'm having trouble with is aligning the dollar sign with the total amount for each tax deduction. Here's what I have so far:
//Output
System.out.println(employeeName);
System.out.printf("==============================\n");
System.out.printf("Federal Income Tax: %11.2f\n", federalIncomeTax);
System.out.printf("State Tax: $%19.2f\n", stateTax);
System.out.printf("Social Security Tax: $%9.2f\n", socialSecurityTax);
System.out.printf("Medicare/Medicaid Tax: $%7.2f\n", medicareMedicaidTax);
System.out.printf("Pension Plan: $%16.2f\n", pensionPlan);
System.out.printf("Health Insurance: $%12.2f\n", healthInsurance);
System.out.printf("===============================\n");
System.out.printf("Net Pay: $%21.2f\n", netPay);
So what do I need to add so the dollar sign will align along with the number?
Comments
They teach you Java because it's on all the job listings, then you end up messing with strings for about an hour trying to get the damned things looking right.
If i was ever in charge of an "intro to programming" class it'd teach C or C++ and put heavy emphasis on data structures and flow, at the end of the day that's what's important, not working around some weird quirk in the Java library.
Once you then have to learn normal java you understand much more about the data flow and can get right into something like C as well as actionscript and all the rest.