當前位置:編程學習大全網 - 編程軟體 - 用MATLAB編程計算,急 謝

用MATLAB編程計算,急 謝

做個測試,希望有所幫助。代碼% By lyqmath

function main()

clc

m = 8400;

taxes = ComputeTaxes(m)function taxes = ComputeTaxes(m)mm = m - 3500;

if mm <= 0

taxes = 0;

return;

end

if mm <= 1500

taxes = mm*3/100 - 0;

return;

end

if mm <= 4500

taxes = mm*10/100 - 105;

return;

end

if mm <= 9000

taxes = mm*20/100 - 555;

return;

end

if mm <= 35000

taxes = mm*25/100 - 1005;

return;

end

if mm <= 55000

taxes = mm*30/100 - 2755;

return;

end

if mm <= 80000

taxes = mm*35/100 - 5505;

return;

end

if mm > 80000

taxes = mm*45/100 - 13505;

return;

end

結果

taxes = 425>>

  • 上一篇:算命先生還玩迷妳世界嗎?
  • 下一篇:圖中為壹軸類零件,材料45鋼,毛坯直徑42mm,試編寫其加工程序。(數控編程)
  • copyright 2024編程學習大全網