My thoughts are to create a method that contains all of the variables declared. Is it better to say initialized?
I would like it to be more efficient but still as clear as possible for future maintenance of the code. Any suggestions for the main bulk of information, such as methods?
if (incomeDec <= 300)
{
taxRateDec1 = 0.15m;
taxDec = incomeDec * taxRateDec1;
}
else if (incomeDec <= 450)
{
tierAmtInt = 300;
taxRateDec1 = 0.15m;
taxRateDec2 = 0.2m;
tempValueDec = tierAmtInt * taxRateDec1;
taxDec = (incomeDec - tierAmtInt) * taxRateDec2;
taxDec = taxDec + tempValueDec;
}
else
{
tierAmtInt = 300;
tierAmtInt2 = 150;
taxRateDec1 = 0.15m;
taxRateDec2 = 0.2m;
taxRateDec3 = 0.25m;
tempValueDec = tierAmtInt * taxRateDec1;
tempValueDec = tempValueDec + tierAmtInt2 * taxRateDec2;
taxDec = (incomeDec - tempValueDec) * taxRateDec3;
taxDec = taxDec + tierAmtInt;
}
incomeDec = incomeDec - taxDec;