Sep 9, 2016 at 6:30pm Sep 9, 2016 at 6:30pm UTC
I have been thru the other forums on this issue, but cannot find a solution to this issue. If anyone can provide some assistance, I would appreciate it. This error is showing for the "stateCode" int the "if" statement. See the following:
double salesTaxCalc(double totalSalesAmt, string stateCode)
{
double salesTaxAmt;
double totalSalesAmt;
string stateCode;
char KS;
if (stateCode = KS)
salesTaxAmt = totalSalesAmt * KS_SALES_TAX_RATE;
else
salesTaxAmt = totalSalesAmt * MO_SALES_TAX_RATE;
return salesTaxAmt;
}
Sep 9, 2016 at 6:47pm Sep 9, 2016 at 6:47pm UTC
You've put a single equals sign instead of double equals.
Sep 9, 2016 at 6:58pm Sep 9, 2016 at 6:58pm UTC
You've put a single equals sign instead of double equals.
Although equality wouldn't make sense either, since KS is an uninitialized char variable.
Perhaps you meant:
if (stateCode == "KS" ) ...
Last edited on Sep 9, 2016 at 6:59pm Sep 9, 2016 at 6:59pm UTC