Home > Back-end >  C language of personal income tax calculator, for bosses to help beginning and body parts
C language of personal income tax calculator, for bosses to help beginning and body parts

Time:09-22

For help, new, small new programming, individual income tax is mainly two-dimensional arrays and can't function calls, thank you bosses guidance

CodePudding user response:

Subject specific requirements?

CodePudding user response:

CodePudding user response:

two topic request is a screenshot, thank you for your bosses

CodePudding user response:

No fine writing, reference to amend yourself
 
#include

Int refer [10] [2]=
{
In 1600, {0},
{500, 5},
{2000, 10},
{5000, 15},
{20000} 20,
{40000} 25,
To {60000},
{80000, 35},
{100000, 40},
{100000, 45},
};


Float getSalary ()
{
Float n=1;
While (1)
{
Printf (" input employee wages: \ n ");
The scanf (" % f ", & amp; N);
If (n & gt;=0 & amp; & N & lt; 1000000)
return n;
The else
{
Printf (" input number between 0-1000000: \ n ");
The scanf (" % f ", & amp; N);
}
}
}

Float prvtaxcal (float m, int arr [] [2], int n)
{
Float temp=0.0;
int i;
If (m & lt;=arr [0] [0])
return 0;
The else
{
Temp=m - arr [0] [0].
If (temp & lt; Arr [1] [0])
Return temp * arr [1] [1]/100.0;
Else if (temp & gt; Arr [1] [0] & amp; & Temp & lt;=arr [2] [0])
Return temp * arr [2] [1]/100.0;
Else if (temp & gt; Arr [2] [0] & amp; & Temp & lt;=arr [3] [0])
Return temp * arr [3] [1]/100.0;
Else if (temp & gt; Arr [3] [0] & amp; & Temp & lt;=arr [4] [0])
Return temp * arr [4] [1]/100.0;
Else if (temp & gt; Arr [4] [0] & amp; & Temp & lt;=arr [5] [0])
Return temp * arr [5] [1]/100.0;
Else if (temp & gt; Arr [5] [0] & amp; & Temp & lt;=arr [6] [0])
Return temp * arr [6] [1]/100.0;
Else if (temp & gt; Arr [6] [0] & amp; & Temp & lt;=arr [7] [0])
Return temp * arr [7] [1]/100.0;
Else if (temp & gt; Arr [7] [0] & amp; & Temp & lt;=arr [8] [0])
Return temp * arr [8] [1]/100.0;
Else if (temp & gt; Arr [9] [0])
Return temp * arr [9] [1]/100.0;
}
}

Int main (void)
{
Float salary=1.0, tax=0.0;
Do
{
Salary=getSalary ();
Tax=prvtaxcal (salary, refer, 9);
Salary: printf (" % 10.2 f, tax: % 10.2 f \ n ", salary, tax);
} while (salary & gt; 0);


return 0;
}

CodePudding user response:

Thank you big big help
  • Related