有我的程序。簡單的控制檯輸出格式
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 $
我需要包括計算值輸出。 我該怎麼做?
,詹姆斯,那麼'解釋'這個問題呢?好吧,你有一個程序很棒,但是,你希望用戶如何處理它?你是否面臨一些「問題」,如果是的話,請解釋。 – Ravish