Write a program that calculates and prints the take-home pay for a commissioned sales employee. Perform a compile-time initialization and store the name of Nesbith Lang in a variable called employeeName. Nesbith earns 7% of her total sales as her commission. Her federal tax rate is 18%. She contributes 10% to a retirement program and 6% to Social Security. Her sales this month were $161,432. Produce a formatted report showing the amount for each of the computed items. Select appropriate constants. After you finish displaying Nesbitch Lang's data, change the values and rerun and application.
Output should look like this - before the values are changed: http://imgur.com/Z87aom4 ----------> open this link of image


VulpesRank #55 · 29.2K reputationPosted Feb 4, 2014, 9:21 AM EST
Anyway, I suggest that you 'pretend' you're in the US by changing the culture of the current thread.
I've also just noticed that the question asks you to use constants so I've dealt with that as well:
VulpesRank #55 · 29.2K reputationPosted Feb 4, 2014, 8:55 AM EST
SUNIL GUTTARank #1,832 · 810 reputationPosted Feb 4, 2014, 9:02 AM EST
SUNIL GUTTARank #1,832 · 810 reputationPosted Feb 4, 2014, 9:38 AM EST
Yes your code is very helpful
11:C ... you mentioned right in console.writeline .. actually whats the use of it ??
I only know i.e {0} {1} ... parameters in console.write so we can replace them accordingly with variables
ex :
int a =24;
string b=male;
console.writeline("my age is {0} and i am {}",a,b);
But you are combining things with something like this
Console.WriteLine("Total Sales: {0, 11:C}", sales);
Thank you .. ..
VulpesRank #55 · 29.2K reputationPosted Feb 4, 2014, 9:55 AM EST
When you have something like {0, 11} it means right justify what's in the first placeholder within a field which is 11 characters wide.
If it had been {0, -11} it would have left justified it within an 11 character wide field.
If you have {0, 11:C} then what's in the first placeholder will (as well as being right justified) be formatted using the 'C' format ('C' stands for currency).
Thousand separators will be added where needed and the number will be formatted with 2 places to the right of the decimal point. It will also be preceded by the currency symbol for the current culture.