
That whole problem can be done with nested if/else clauses... Not exactly pretty, but doable.
The best way, if you understand the math now, is simply to pick some sample numbers, and for each, write down (not code, just steps) of how you would break it down and solve it.
Basically,
Code:
Balance = Income
If Income > bracket1 {
If Income > Bracket2 {
If Income > Bracket3 {
Do fixed stuff for Bracket1 and Bracket2, calculate out and add in remainder
}
}
Else {
Do Fixed Stuff for Bracket1, calculate out and add in remainder
}
Else {
Calculate out tax for partial Bracket1
}