I'm a beginner C++ coder having seen most of the code for the very first time over the past few weeks, just to give an idea of my expertise.
In my class we were given the problem to write a program that will calculate income Tax but I am stuck on how to calculate that and was hoping someone could give me an idea on how to proceed...
Here is my confusion... We have tax brackets say the 1st 500 is taxed at 5% and then 2nd 500 is taxed at 8% and the 3rd 500 is taxed at 10% if a person enters an incom of say 1500 I can't figure out how to divy that up so that the tax is properly calculated for all 3 tax rates that would be applied. What I have is basically
if income <=500 then taxrate = .05
else if income >500 and taxrate <=1000 taxrate = .08
else if income >1000 then taxrate = .10
As you can see that would calculate tax using only one tax rate for the entered amount... I'm stuck on how to calculate the tax properly.... Any suggestions?