个人所得税计算器

一直以来工资被扣税都不知道怎么算的,查了一下资料发现笔算起来挺麻烦的(每次都要对着表弄),于是做一个小程序代劳。
(使用2008年3月生效的2000起征点)


主代码如下:

// 计算个人所得税按钮单击事件
         private   void  button2_Click( object  sender, EventArgs e)
        {
            
if  (t_wage.Text.Trim().Length  ==   0 )
                
return ;
            
// 工资上缴个人所得税表  (工资-2000) 之后的起始、终止、税率、减除额
            ArrayList taxTables  =   new  ArrayList();
            taxTables.Add(
new  TaxTable( 0 500 5 0 ));
            taxTables.Add(
new  TaxTable( 500 2000 10 25 ));
            taxTables.Add(
new  TaxTable( 2000 5000 15 125 ));
            taxTables.Add(
new  TaxTable( 5000 20000 20 , 375 ));
            taxTables.Add(
new  TaxTable( 20000 40000 25 1375 ));
            taxTables.Add(
new  TaxTable( 40000 , 60000 30 3375 ));
            taxTables.Add(
new  TaxTable( 60000 80000 35 6375 ));
            taxTables.Add(
new  TaxTable( 80000 100000 40 10375 ));
            taxTables.Add(
new  TaxTable( 100000 double .MaxValue,  45 15375 ));
            msg.ForeColor 
=  Color.Tomato;
            
try
            {
                
double  wage  =   double .Parse(t_wage.Text);
                
double  wage_Tax = wage - 2000 ;
                
double  tax = 0 ;
                
foreach  (TaxTable tb  in  taxTables)
                {
                    
if (wage_Tax > tb.tax_low && wage_Tax <= tb.tax_up)
                    {
                        tax 
=  wage_Tax  *  tb.taxRate  /   100   -  tb.deduct;
                        
break ;
                    }
                }
                
double  remain  =  wage  -  tax;
                msg.Text 
=   " 税前工资: "   +  t_wage.Text  +   " 元\r\n "   +
                 
" 税后工资: "   +  remain.ToString()  +   " 元\r\n "   +
                 
" 应交个人所得税: "   +  tax.ToString()  +   " " ;
            }
            
catch  (Exception ex)
            {
                msg.Text 
=  ex.Message;
            }
        }
        
///   <summary>
        
///  存放个人所得税税率表的类
        
///   </summary>
         class  TaxTable
        {
            
public   double  tax_low;  // 工资-2000后
             public   double  tax_up;   // 工资-2000后
             public   int  taxRate;     // 取值范围0--100
             public   int  deduct;      // 减除额
             public  TaxTable( double  Ptax_low,  double  Ptax_up,  int  PtaxRate,  int  Pdeduct)
            {
                tax_low 
=  Ptax_low;
                tax_up 
=  Ptax_up;
                taxRate 
=  PtaxRate;
                deduct 
=  Pdeduct;
            }
        }


要是有需要又懒得自己实现,这里有下载:

源码下载: Code    演示版(可当小工具使用): Demo

转载于:https://www.cnblogs.com/tuyile006/archive/2007/09/15/894389.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值