c++ federal income tax must be withheld from the employee's gross pay. for this project, federal income tax is 10% of gross pay for the first $1000, 15% on the next $15000 and 25% on amounts above $2500, So it should calculate like gross pay is $4000.00 then 10% of the first 1000 = 100, then 15% of the next $1500 = $225 and then 25% on the any amount left over $2,500 in this case would be $1500 * 25% = 375 So total's for all three brackets are $700.
I'm trying to use if statemetns but i'm having trouble storing each amount in a particular variable and not having them over lap - and then add them up at the end to get my total?
Trying to do something like this
if (fedTotalPay>0 && fedTotalPay <=1000)
fedtax =.10 * fedTotalPay;
if (fedTotalPay >1000)
(fedtax1 = (fedTotalPay -1000)) *.10;
if (fedTotalPay >1000 && fedTotalPay <2500)
(fedtax2 = (fedTotalPay -1500)) *.15;
if (fedTotalPay >2500)
(fedtax3 = (fedTotalPay -2500)) *.25;