VB编程题,急解决,VB高手帮下忙!
这里将个人所得税具体计算问题理想化,假设以1000元作为标准,1000~1999的税率为5%,2000~4999的税率为10%,5000~9999的税率为25%,1000...
这里将个人所得税具体计算问题理想化,假设以1000元作为标准,1000~1999的税率为5%,2000~4999的税率为10%,5000~9999的税率为25%,10000~19999的税率为40%,20000以上的税率为45%。
请问这题这样做对不对啊?
Private Sub Command1_Click()
dim n as long
n=val(inputbox("请输入金额:"))
if n<=1000 then
msgbox("你不需要交纳税额!")
else
if n>1000 and n<=1999 then
n=n*0.05
else
if n>=2000 and n<=4999 then
n=n*0.1
else
if n>=5000 and n<=9999 then
n=n*0.25
else
if n>=10000 and n<=19999 then
n=n*0.4
else
if n>=20000 then
n=n*0.4
endif
msgbox("你应缴纳的税额为:"&n)
End Sub 展开
请问这题这样做对不对啊?
Private Sub Command1_Click()
dim n as long
n=val(inputbox("请输入金额:"))
if n<=1000 then
msgbox("你不需要交纳税额!")
else
if n>1000 and n<=1999 then
n=n*0.05
else
if n>=2000 and n<=4999 then
n=n*0.1
else
if n>=5000 and n<=9999 then
n=n*0.25
else
if n>=10000 and n<=19999 then
n=n*0.4
else
if n>=20000 then
n=n*0.4
endif
msgbox("你应缴纳的税额为:"&n)
End Sub 展开
1个回答
展开全部
dim income, tax as double
select case income
case is < 1000
tax = 0.0
case 1000 to 1999
tax = 0.05 * income
case 2000 to 4999
tax = 0.05 * 2000 + 0.10 * (income - 2000)
case 5000 to 9999
tax = 0.05 * 2000 + 0.10 * 3000 + 0.25 * (income - 5000)
case 10000 to 19999
tax = 0.05 * 2000 + 0.10 * 3000 + 0.25 * 5000 + 0.4 * (income - 10000)
case is >= 20000
tax = 0.05 * 2000 + 0.10 * 3000 + 0.25 * 5000 + 0.4 * 10000 + (income-20000)
end select
select case income
case is < 1000
tax = 0.0
case 1000 to 1999
tax = 0.05 * income
case 2000 to 4999
tax = 0.05 * 2000 + 0.10 * (income - 2000)
case 5000 to 9999
tax = 0.05 * 2000 + 0.10 * 3000 + 0.25 * (income - 5000)
case 10000 to 19999
tax = 0.05 * 2000 + 0.10 * 3000 + 0.25 * 5000 + 0.4 * (income - 10000)
case is >= 20000
tax = 0.05 * 2000 + 0.10 * 3000 + 0.25 * 5000 + 0.4 * 10000 + (income-20000)
end select
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询