Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Programming Problem #1 A country has the following tax structure: Annual Gross I

ID: 2293615 • Letter: P

Question

Programming Problem #1 A country has the following tax structure: Annual Gross Income (S) 0-15,000 15,001-30,000 30,001- 50,000 50,001-80,000 80,001- 120,000 Over 120,000 Tax None 18% for each dollar over 15,000 $2,500 + 23% for each dollar over 30.000 $7,560 + 28% for each dollar over 50.000 $15,950 + 32% for each dollar over 80,000 | $29.050 38% for each dollar over 120.000 Write an M-file that when executed will request an annual gross income to be entered in dollars (S) and will display the tax owed on the command window. Demonstrate your program with the following 5 incomes and presenttheM-file and the commandwindowr containing al inputs and es $17,068 $42,687 S68,903 $100,260 $254,661

Explanation / Answer

I am giving you a code for function that will return tax.

function A = tax(P, r, )
{
If(P<15000)
{ A =0;
}
elseif(P>=15001 && P<30000)
{A= 0.18* (P-15000);
}
elseif(P>=30001 && P< 50000)
{ A= 2500 + 0.23*(P-30000);
}
elseif(P >= 50001 && P < 80000)
{ A = 7560 + 0.28*(P - 50000);
}
elseif( P>= 80001 && P < 120000)
{ A = 15950 + 0.32*(P - 80000) ;
}
elseif( P>= 120001)
{ A = 29050 + 0.38*(P - 120000);
}
}

Use it in MATLAB you will see desired result.