1
我有一个非常简单的程序,由用户来计算基于输入总量和净工资,我得到净重和毛重付出同样的数字。谁能告诉我,为什么在此基础上的税收不被考虑?我省略了一些代码,所以它应该是足够小,有人快速读取。净工资=工资总额的问题
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter tax percentage: 23 for divorced, 13 for widowed, 15 for married, 22 for single");
taxPercentage = Int16.Parse(Console.ReadLine());
double statusTax = taxPercentage/100;
Console.WriteLine("Enter amount of overtime hours earned");
overtimeHours = Convert.ToDouble(Console.ReadLine());
overtimeRate = 1.5;
double overtimePay = overtimeHours * overtimeRate;
double grossPay = overtimePay + normalPay;
double netPay = grossPay - (grossPay * statusTax);
Console.WriteLine("Gross Pay is");
Console.WriteLine(grossPay);
Console.WriteLine("Net pay is");
Console.WriteLine(netPay);
}
}
}
任何人有任何输入?
非常感谢你的帮助。这完全解决了这一问题。你是天赐之物。 –