Help with void calculation

I probably just need to fix the if statements. But anyways, when I compile, the fedTax always ends being something like -0.00000000001293844... Any tips would be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void calcTax (double& fedTax, int numDepend, double grossPay, double& taxRate)
{
	
	if (numDepend = 0)
	{
		taxRate = .2;
	}
	if ((numDepend > 0) && (numDepend < 5))
	{
		taxRate = .15;
	}
	if ((numDepend > 4) && (numDepend < 7))
	{
		taxRate = .1;
	}
	if (numDepend > 6)
	{
		taxRate = .07;
	}
	fedTax = grossPay * taxRate;
}
Line 4: if (numDepend = 0)

What's wrong with this?
Last edited on
Line 4: should be comparison operator== instead of assignment operator=
What you would have is:
if(numDepend == 0)
Topic archived. No new replies allowed.