谁帮帮我一个简单的ASP???

来源:百度知道 编辑:UC知道 时间:2024/05/16 11:56:03
按照下面的写一个代码,计算最后的运费??
1公斤以下:
30千米以内0.5元/公斤/千米,30-50是1,50-300是1.5
1---15公斤:
30千米以内1元/公斤/千米,30-50是2,50-300是3

if **<1 then
if **<30 then
**=0.5
elseif **>=30 and **<50 then
**=1
elseif **>=50 and **<300 then
**=1.5
end if
elseif **>=1 and **<1.5 then
if **<30 then
**=1
elseif **>=30 and **<50 then
**=2
elseif **>=50 and **<300 then
**=3
end if
end if

写个简单的函数吧
function js(a,b)
'a为重量 b为距离
'先来个初始数值 假设价格重量小于1 距离在30千米内 price就是价格了
price = 0.5
'然后就是几个if了
if a <= 1 then
if b > 0 and b <=30 then price = 0.5
if b > 30 and b <=50 then price = 1
if b > 50 and b <=300 then price = 1.5
if b > 300 then b = '哈哈 这个你没设定 自己想吧 距离远了
end if

if a > 1 and a <=1.5 then
if b > 0 and b <=30 then price = 1
if b > 30 and b <=50 then price = 2
if b > 50 and b <=300 then price = 3
if b > 30