QUOTE(William_Wilson @ 15 Mar, 2007 - 06:06 PM)

TAXABLE >= 15001 && TAXABLE <=40000)
pretty sure this should be an or || since the same variable can never be both of those values at once.
*Any change of working in a case of if(name.equals("William Wilson")) { return "tax exempt!"; } ? lol
Actually using the AND operand is correct. If you use the OR operand then as long as the first condition is true, it will never evaluate the second condition.
@Phantom_of_the_opera
In your taxAmount method the only place that you assign a value to Final is here:
CODE
if(TAXABLE >= 15001 && TAXABLE <=40000)
{
Total = (TAXABLE - 2250);
cout << Total << endl;
if(Total >15000)
{
TaxPercent = (Total * .25);
Final = Total + TaxPercent;
cout << TaxPercent << endl << Final << endl;
}
}
if(TAXABLE > 40000)
{
Total = (TAXABLE - 8460);
if(Total > 40000)
{
TaxPercent = (Total * .35);
Final = Total + TaxPercent;
cout << TaxPercent << endl << Final << endl;
}
What happens if TAXABLE is 15001 at this point?
Your code enters the first IF statement because it evaluates to true. The first thing you do is put a value in Total equal to (15001 - 2250) = 12751, you then output the value of Total and then enter another IF statement
if(Total >15000). Since total is currently 12751 this statement will evaluate to false. The next IF statement will also evaluate to false,
if(TAXABLE > 40000). At this point Final has never been assigned a value and as such still has its default value of 0.
I think your second IF statement does not take into account the subtraction of 2250 in the beginning after the first IF statement. Perhaps it should be
if(Total >12751).
On a side note, is it possible that TAXABLE can be a value greater 15001 or less then 40000?
If this is the case, it is possible you never get past the first IF statement.