hypGnosis von Schwarz

Greenhorn
+ Follow
since Oct 01, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by hypGnosis von Schwarz

Linda, Hello again!

Hope you check back, because I have one additional comment.

You should remove the statement at line 50: if (projectedAnnual <= 6000)
and simply let the tax bracketing fall through to: yearTax = 0.00 ... the default tax amount

Besides that, what if the taxable amount is exactly 6000? It is referenced with equal signs in both lines 47 and 50.

Drop line 50 & you're on your way.
11 years ago
Linda Hi!

First thing that caught my eye was:

What if 'projectedAnnual' equaled exactly 6000? Which 'if' stmt do you want to be followed? (<= 6000 or >= 6000)?

Since 'projectedAnnual' tops out at 150000, perhaps that should be the first amount tested, no?

With an ascending set of values, your code will never get to anything past the 'greater-than' 6000... cuz it's all greater than 6000, i.e., 25000 > 6000, 75000 > 6000, 150000 > 6000.

Flip the sequence & you'll be a happy camper!
11 years ago