Pawel

Pawel

  • NA
  • 1
  • 0

Newbie question relating to number formatting.

May 28 2006 6:44 PM

Brief Information: Salary program that outputs differently based on tax brackets. Completed for school

Problem: Numbers need to be right aligned instead of left. I' ve just been introduced to c# so i dont know if there are any text formatting tricks :)  If additional information is needed, please say so. Any help on this matter is appreciated. Thanks

(all variables are defined as floats, I suspect I may have to parse them to strings to align them evenually to the right)



Output: 

Console.WriteLine("Salary Calculator" );

Console.WriteLine("" );

Console.WriteLine("Enter the gross salary of the employee:" +grossSalary );

Console.WriteLine("" );

Console.WriteLine("Gross Salary $" +grossSalary);

Console.WriteLine("Canadian Pension Plan - $" +CalculateCPP(grossSalary));

Console.WriteLine("Employment Insurance - $" +CalculateEI(grossSalary));

Console.WriteLine("Provinical Tax - $" +CalculatePTax(grossSalary));

Console.WriteLine("Federal Tax - $" +CalculateFTax(grossSalary));

Console.WriteLine(" -------------");

Console.WriteLine("Net Salary $" +netSalary);



 


Answers (1)