vb编程软件_用VB编程来解决实际生活问题

今天,我们共同来学习用VB编程开发的实际应用软件--个人所得税快速计算程序。

个人所得税是调整征税机关与自然人之间在个人所得税的征纳与管理过程中所发生的社会关系的法律规范的总称。

目前最新的起征点为每月5000元。

个人所得税税率表

d75a7b6c6b944ab788add5f74e5b0ca0.png

由上面的表格数据,接下来我们利用VB编程来实现本功能。

首先,根据税率对应的数据,我们可以知道不同的数值范围对应的计算税率不同,于是我们就应该想到用VB编程中的选择结构语句来实现本功能。

b63ad485a9102bd5cc1437135338821c.gif

程序代码

b63ad485a9102bd5cc1437135338821c.gif

Dim x As Double, y As Double, w As Double, s As Double, t As Double


Private Sub Command1_Click()

t = Val(Text1.Text) - Val(Text2.Text) '工资所得-五险一金

MsgBox (t)

Select Case t

    Case Is <= 0

        Text3.Text = 0

        Text4.Text = Val(Text1.Text)

    Case 0 To 3000

        Text3.Text = t * 0.03

        Text4.Text = Val(Text1.Text) - Val(Text3.Text)

    Case 3000 To 12000

         Text3.Text = t * 0.1 - 210

         Text4.Text = Val(Text1.Text) - Val(Text3.Text)

    Case 12000 To 25000

        Text3.Text = t * 0.2 - 1410

        Text4.Text = Val(Text1.Text) - Val(Text3.Text)

    Case 25000 To 35000

         Text3.Text = t * 0.25 - 2660

         Text4.Text = Val(Text1.Text) - Val(Text3.Text)

    Case 35000 To 55000

         Text3.Text = t * 0.3 - 4410

         Text4.Text = Val(Text1.Text) - Val(Text3.Text)

    Case 55000 To 80000

         Text3.Text = t * 0.35 - 7160

         Text4.Text = Val(Text1.Text) - Val(Text3.Text)

    Case Is > 80000

         Text3.Text = t * 0.45 - 15160

         Text4.Text = Val(Text1.Text) - Val(Text3.Text)

End Select

End Sub

Private Sub Command2_Click() '清除Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""End Sub
Private Sub Form_Load() '窗体载入代码Text1.Text = ""Text2.Text = ""Text3.Text = ""Text4.Text = ""End Sub

Private Sub Text1_LostFocus() '验证数据

    If Not IsNumeric(Text1.Text) Then

        MsgBox ("请输入数字")

        Text1.Text = ""

        Text1.SetFocus

    End If

End Sub

Private Sub Text2_LostFocus() '验证数据

 If Not IsNumeric(Text2.Text) Then

        MsgBox ("请输入数字")

        Text2.Text = ""

        Text2.SetFocus

    End If

End Sub


e9f26f5c2c03060faf3aa4d535dba826.png

实际运行图

有了这个程序,以后计算所得税就不用网上搜索或者计算器计算了,用VB直接点击后,数据结果立即出现,快快试试吧~

ec7cdecf9a0f29e40151af1175b232e2.png

祝大家学习成功!

6245d320c2906a7fde9d502d8568fddc.png

VB学习有问题,就找跟我学VB!

大家在学习过程中有学习问题,可以添加小编微信号:vbyjk521 ,小编会耐心提供在线解答。

VB全套视频讲解资料现在优惠发放中,要学好VB编程的朋友可以添加小编微信。

b6700baa49a2fad8c2ee0ff7054dc4aa.png       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值