t=input('Enter total income: ');% Calculate Tax due
if (0<t<=6000) due= 0elseif (6000<t<=34000) due= 0.15*(t-6000)elseif (34000<t<=80000) due= 4200+0.30*(t-34000)elseif (80000<t<=180000) due= 18000+0.40*(t-80000)elseif (180000<t) due= 58000+0.45*(t-180000)else disp('invalid input')end
MATLAB: Trying to calculate tax due based on varying reported taxable incomes. All input values return the if statement condition ($0).
if statement
Best Answer