Есть моя программа.Форматирование простого консольного вывода
static void Main(string[] args)
{
double weeklySales = 0, grossPay = 0, fedTax = 0, socSecurity = 0, retirement = 0, totDeductions = 0, takeHomePay = 0;
Console.WriteLine("Please enter your total for sales for the week.");
weeklySales = Convert.ToDouble(Console.ReadLine());
grossPay = weeklySales * .07;
fedTax = grossPay * .18;
socSecurity = grossPay * .06;
retirement = grossPay * .1;
totDeductions = fedTax + socSecurity + retirement;
takeHomePay = grossPay - totDeductions;
Console.WriteLine("Your total sales for the week were $ ", weeklySales);
Console.WriteLine("Your gross pay for the week was $ ", grossPay);
Console.WriteLine("Your Federal Taxes for the week were $ ", fedTax);
Console.WriteLine("You were deducted $ ", socSecurity, " for social security.");
Console.WriteLine("Your retirement contribution was $ ", retirement);
Console.WriteLine("The total amount of of deductions were $ ", totDeductions);
Console.WriteLine("Your take home pay for the week is $ ", takeHomePay);
Console.ReadLine();
}
Проблема в неправильном выходе.
Please enter your total for sales for the week. 123 Your total sales for the week were $ Your gross pay for the week was $ Your Federal Taxes for the week were $ You were deducted $ Your retirement contribution was $ The total amount of of deductions were $ Your take home pay for the week is $
Мне нужно включить вычисленные значения для вывода. Как я могу это сделать?
хорошо, Джеймс, как насчет «объяснения» проблемы? хорошо, здорово, что у вас есть программа, но что вы хотите, чтобы SO-пользователи сделали с ней? вы сталкиваетесь с какой-то «проблемой», если да, пожалуйста, объясните. – Ravish