I'm experiencing problem while calculating PAYE. Can someone assist me on how I should be approving this.
Here are the percentage and brackets for PAYE.
Upto 24000, 10%
Between 24001-40667, 15%
Between 40668-57334, 20%
Above 57334, 25%
There's a relief of 2400.
Here's my code:
double grossIncome=Convert.ToDouble(txtgross.Text):
private double getTax(double gross)
{
if(gross <=24000) return(gross*0.1);
if(gross >=24001 | gross <=40667) return(gross*0.15);
if(gross >=40668 | gross <=57334) return(gross*0.2);
return (57335+(gross*0.25);
}
To calculate PAYE:.
private void btnCalculate_Click(object sender,EventArgs e)
{
PAYE=getTax(grossIncome)-2400;
txtPaye.Text=PAYE.ToString();
}
I'm getting less PAYE value.