I have parced and hacked this function every which way, but can't figure out why it gives the wrong result for the middle statement. If you see something I don't please advise. If you need to see the entire code I'll post it.
1 2 3 4 5 6 7 8 9 10 11
double calcTax(double)
{
if (net <= 15000)
netnet = net * 0.15;// THIS IS ACCURATE
elseif (net>=15001&&net<=40,000)
netnet = 0.25*(net-15000)+2250;// ... BUT THIS ISN'T!!!
elseif (net>=40,001)
netnet = 0.35*(net-40000)+8460; // YET THIS IS!!!
return netnet;
}
they're defined elsewhere. I will remove the commas (dumb) and see if it works. I'll bet it does.
(20 seconds later) THANK YOU. vlkon. Good eye! I guess sometimes we can stare at something and yet not see it. Lesson learned. Thanks again!!!