VB编程题,急解决,VB高手帮下忙!

2024年11月16日 22:47
有1个网友回答
网友(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