In the country of Elbonia, personal income tax is calculated as follows: For the
ID: 3196942 • Letter: I
Question
In the country of Elbonia, personal income tax is calculated as follows:
For the first $12 000 no tax is owed. From $12 000 to $30 000, 20% income tax is owed. From $30 000 to $60 000, 28% tax is owed. From $60 000 to $110 000, 35% is owed. From $110 000 and up 45% is owed.
So for example, if a permanent resident of Antegria makes $125 000 in a year, they would pay:
$0 dollars for the first $12 000,
$ 3 600 for the amount from 12 000 to 30 000 ((30 000 - 12 000)*0.2),
$ 8 400 for the amount from 30 000 to 60 000 ((60 000 - 30 000)*0.28),
$17 500 for the amount from 60 000 to 110 000 ((110 000 - 60 000)*0.35),
$ 6 750 for the amount from 110 000 to 125 000 ((125 000 - 110 000)*0.45),
For a total of 3600 + 8400 + 17 500 + 6 750 = $ 36 250
Create a C program based on the flowchart provided in this folder. The user inputs an income and the program calculates the income tax based on the above example (and the flowchart). The part of the programming that calculates the tax is provided as a separate function (see flowchart). you must use the function provided to receive marks for this assignment.
CALCTAX FUNCTION START float CalcTax(float i, float a, float b, float c) float TAX; input: income, store in I TAX = a+(1-(c*1000)) * b; return TAX; Ls ves I 4 12,e00 tax = no ves tax = Ca LcTax (I,e,0.2,12) 1 30,000 no 1 60,000 (I, 3600,0.28, 30) is ves tax = Ca LcTax 1 110,000 (I,12000,e.35,60) no tax = Ca LcTax (I,29500,0.45,11e) output: "tax owed is:" tax ENDExplanation / Answer
#include<stdio.h>
float CalcTax(float i , float a, float b, float c) ;
int main()
{
float i,tax;
printf("Enter Income: ");
scanf("%f", &i);
if(i<=12000)
{
tax = 0;
printf("TAX = %f",tax);
}
else if(i<=30000)
{
tax = CalcTax(i,0,0.2,12);
printf("TAX = %f",tax);
}
else if(i<=60000)
{
tax = CalcTax(i,3600,0.28,30);
printf("TAX = %f",tax);
}
else if (i<=110000)
{
tax = CalcTax(i,12000,0.35,60);
printf("TAX = %f",tax);
}
else
{
tax = CalcTax(i,29500,0.45,110);
printf("TAX = %f",tax);
}
return 0;
}
float CalcTax(float i , float a, float b, float c)
{
float TAX;
TAX = a+(i-(c*1000))*b;
return TAX;
}