twc
Posts: 129
Nickname: twc
Registered: Feb, 2004
|
|
Re: need help !
|
Posted: Mar 28, 2004 11:46 AM
|
|
a. I would think that income would be a double, not an int
b. If they get a 10% discount, then they pay taxes on 90% of their income. Multiply by .9. BTW, don't use 90/100 because 90/100 comes out to 0 due to integer division. If you must use a fraction, use 90.0/100.0 to force the quotient to be a double. You probably will experience similar problems with the other fractions that you have listed.
c. I might create another variable called taxableIncome which would equal incomeNum if they are under 50, but be 90% of incomeNum if they are 50 or over. That way you retain the original income value if you need it later. If you do this, don't forget to use taxableIncome in your calculations in the if statement.
I hope this helps. twc
|
|