先制作類似這種管理數據的VFP表格
然後就是這些代碼了,do?……case分支結構的,自己想想吧,跟if-endif的方法很相似的。
close?all?
use?工資表
go?top
do?while?not?eof()
sk=工資-800?&&sk表示計算稅款的基數
if?sk<=500
se=(工資-800)*0.05&&se表示應收稅額else
sk=工資-800-500if?sk<=2000
se=500*0.05+(sk)*0.1
else
if?sk<=5000
se=500*0.05+(sk)*0.15
else if?sk<=20000se=500*0.05+(sk)*0.2
else if?sk<=40000se=500*0.05+(sk)*0.25
else? if?sk<=60000
se=500*0.05+(sk)*0.3
elseif?sk<=80000
se=500*0.05+(sk)*0.35
elseif?sk<=100000
se=500*0.05+(sk)*0.4
? else
? if?sk>100000
? se=500*0.05+(sk)*0.45
? endif
? endif
endif endif? endif? endif? endif? endifendif
replace?稅額?with?se
skip
enddo